fix non-det test failure that looks for entity state changes it just wasn't always waiting on the initial value
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/de32889c Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/de32889c Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/de32889c Branch: refs/heads/master Commit: de32889cb3fb2110f5e0b2821b31a8afbdbf9b15 Parents: a2a6ae2 Author: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Authored: Sat Sep 15 00:48:16 2018 +0100 Committer: Alex Heneveld <alex.henev...@cloudsoftcorp.com> Committed: Sat Sep 15 00:48:16 2018 +0100 ---------------------------------------------------------------------- .../camp/brooklyn/VanillaSoftwareProcessYamlTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/de32889c/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/VanillaSoftwareProcessYamlTest.java ---------------------------------------------------------------------- diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/VanillaSoftwareProcessYamlTest.java b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/VanillaSoftwareProcessYamlTest.java index 5a9a207..f88fbcc 100644 --- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/VanillaSoftwareProcessYamlTest.java +++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/VanillaSoftwareProcessYamlTest.java @@ -143,6 +143,10 @@ public class VanillaSoftwareProcessYamlTest extends AbstractYamlTest { RecordingSensorEventListener<Object> serviceUpListener = subscribe(entity, Attributes.SERVICE_UP); RecordingSensorEventListener<Object> serviceStateListener = subscribe(entity, Attributes.SERVICE_STATE_ACTUAL); + // ensure these get the initial values because test relies on that later + assertEventsEqualEventually(serviceStateListener, ImmutableList.of(Lifecycle.CREATED), true); + assertEventsEqualEventually(serviceUpListener, ImmutableList.of(false), true); + Task<Void> task = app.invoke(Startable.START, ImmutableMap.of()); // Should eventually poll for 'checkRunning', before reporting 'up' @@ -217,6 +221,10 @@ public class VanillaSoftwareProcessYamlTest extends AbstractYamlTest { RecordingSensorEventListener<Object> serviceUpListener = subscribe(entity, Attributes.SERVICE_UP); RecordingSensorEventListener<Object> serviceStateListener = subscribe(entity, Attributes.SERVICE_STATE_ACTUAL); + // ensure these get the initial values because test relies on that later + assertEventsEqualEventually(serviceStateListener, ImmutableList.of(Lifecycle.CREATED), true); + assertEventsEqualEventually(serviceUpListener, ImmutableList.of(false), true); + Task<Void> task = app.invoke(Startable.START, ImmutableMap.of()); // Should eventually poll for 'checkRunning', but just once immediately after doing launch etc