Repository: brooklyn-server
Updated Branches:
  refs/heads/master b5508747f -> 43a861c49


Enable more tests fixed by sensor order guarantees

Test-only subset of #641


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/bc0b3926
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/bc0b3926
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/bc0b3926

Branch: refs/heads/master
Commit: bc0b392654624b3e36c411d1e555858a2e1cf1ff
Parents: 05d6ee0
Author: Svetoslav Neykov <[email protected]>
Authored: Fri Apr 7 18:56:31 2017 +0300
Committer: Alex Heneveld <[email protected]>
Committed: Thu Oct 19 17:37:59 2017 +0100

----------------------------------------------------------------------
 .../ApplicationLifecycleStateStressTest.java    |  9 +-----
 .../entity/ApplicationLifecycleStateTest.java   | 34 +++++++-------------
 2 files changed, 12 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/bc0b3926/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateStressTest.java
----------------------------------------------------------------------
diff --git 
a/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateStressTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateStressTest.java
index 02f8ec2..aa1790d 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateStressTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateStressTest.java
@@ -67,28 +67,21 @@ public class ApplicationLifecycleStateStressTest extends 
ApplicationLifecycleSta
         super.testStartsThenSomeChildFailsCausesAppToFail();
     }
 
-    /** See {@link 
ApplicationLifecycleStateTest#testChildFailuresOnStartButWithQuorumCausesAppToSucceed()}
 for details on the failure */
-    @Test(groups="Broken")
     @Override
     public void testChildFailuresOnStartButWithQuorumCausesAppToSucceed() 
throws Exception {
         super.testChildFailuresOnStartButWithQuorumCausesAppToSucceed();
     }
-    
-    /** See {@link 
ApplicationLifecycleStateTest#testChildFailuresOnStartButWithQuorumCausesAppToSucceed()}
 for details on the failure */
-    @Test(groups="Broken")
+
     @Override
     public void testStartsThenChildFailsButWithQuorumCausesAppToSucceed() 
throws Exception {
         super.testStartsThenChildFailsButWithQuorumCausesAppToSucceed();
     }
 
-    /** See {@link 
ApplicationLifecycleStateTest#testChildFailuresOnStartButWithQuorumCausesAppToSucceed()}
 for details on the failure */
-    @Test(groups="Broken")
     @Override
     public void testStartsThenChildFailsButWithQuorumCausesAppToStayHealthy() 
throws Exception {
         super.testStartsThenChildFailsButWithQuorumCausesAppToStayHealthy();
     }
 
-    @Test(groups="Broken")
     @Override
     public void testSettingSensorFromThreads() {
         super.testSettingSensorFromThreads();

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/bc0b3926/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
----------------------------------------------------------------------
diff --git 
a/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
 
b/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
index a5613b8..470d0bf 100644
--- 
a/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
+++ 
b/core/src/test/java/org/apache/brooklyn/core/entity/ApplicationLifecycleStateTest.java
@@ -176,18 +176,7 @@ public class ApplicationLifecycleStateTest extends 
BrooklynMgmtUnitTestSupport {
         assertHealthEventually(app, Lifecycle.ON_FIRE, false);
     }
 
-    // TODO Fails in a full `mvn clean install`, but I can't get it to fail in 
Eclipse running 
-    // lots of times, or with `mvn test -Dtest=ApplicationLifecycleStateTest`. 
The failure is:
-    //     java.lang.AssertionError: (Dumped entity info - see log); 
entity=Application[6q37l8cu]; state=on-fire; up=true; notUpIndicators={}; 
serviceProblems={service-lifecycle-indicators-from-children-and-members=Required
 entity not healthy: FailingEntityImpl{id=exz9n1pti0}}
-    //     at 
org.apache.brooklyn.core.entity.ApplicationLifecycleStateTest.assertUpAndRunningEventually(ApplicationLifecycleStateTest.java:204)
-    //     at 
org.apache.brooklyn.core.entity.ApplicationLifecycleStateTest.testChildFailuresOnStartButWithQuorumCausesAppToSucceed(ApplicationLifecycleStateTest.java:146)
-    //
-    // See https://github.com/apache/brooklyn-server/pull/452 and 
https://github.com/apache/brooklyn-server/pull/454 
-    // for further discussion of fix/issue.
-    //
-    // AbstractMultipleSensorAggregator.onEvent sees SERVICE_STATE_ACTUAL 
events in the wrong order (running, starting) which leads to 
-    // the quorum check failing in 
ComputeServiceIndicatorsFromChildrenAndMembers.
-    @Test(groups="Broken")
+    @Test
     public void testChildFailuresOnStartButWithQuorumCausesAppToSucceed() 
throws Exception {
         TestApplication app = 
mgmt.getEntityManager().createEntity(EntitySpec.create(TestApplication.class)
                 .configure(StartableApplication.UP_QUORUM_CHECK, 
QuorumCheck.QuorumChecks.atLeastOne())
@@ -200,8 +189,7 @@ public class ApplicationLifecycleStateTest extends 
BrooklynMgmtUnitTestSupport {
         assertUpAndRunningEventually(app);
     }
 
-    // Same as testChildFailuresOnStartButWithQuorumCausesAppToSucceed
-    @Test(groups="Broken")
+    @Test
     public void testStartsThenChildFailsButWithQuorumCausesAppToSucceed() 
throws Exception {
         TestApplication app = 
mgmt.getEntityManager().createEntity(EntitySpec.create(TestApplication.class)
                 .configure(StartableApplication.UP_QUORUM_CHECK, 
QuorumCheck.QuorumChecks.atLeastOne())
@@ -223,8 +211,7 @@ public class ApplicationLifecycleStateTest extends 
BrooklynMgmtUnitTestSupport {
         mgmt.getEntityManager().unmanage(app);
     }
 
-    // Same as testChildFailuresOnStartButWithQuorumCausesAppToSucceed
-    @Test(groups="Broken")
+    @Test
     public void testStartsThenChildFailsButWithQuorumCausesAppToStayHealthy() 
throws Exception {
         TestApplication app = 
mgmt.getEntityManager().createEntity(EntitySpec.create(TestApplication.class)
                 .configure(StartableApplication.UP_QUORUM_CHECK, 
QuorumCheck.QuorumChecks.atLeastOne())
@@ -241,15 +228,16 @@ public class ApplicationLifecycleStateTest extends 
BrooklynMgmtUnitTestSupport {
     }
 
     /**
-     * Sensor value does not match the order of events. For example events are 
running, starting,
-     * but sensor value is running.
-     * Causes a problem with ComputeServiceIndicatorsFromChildrenAndMembers 
which will flag the entity
-     * on-fire event though children are running.
+     * Tests concurrent modifications to a sensor, asserting that the last 
notification the subscribers 
+     * receives equals the last value that sensor has.
      * 
-     * Indeterministic, fails a couple of times per 100 invocations when run 
with "mvn test" in the
-     * brooklyn-itest docker container.
+     * Prior to this being fixed (see 
https://github.com/apache/brooklyn-server/pull/622), it caused 
+     * problems in ComputeServiceIndicatorsFromChildrenAndMembers: it saw a 
child transition 
+     * from "running" to "starting", and thus emitted the on-fire event for 
the parent entity. As asserted
+     * by this test, the enricher should now always receive the events in the 
correct order (e.g. "starting",
+     * "running").
      */
-    @Test(groups="Broken")
+    @Test
     public void testSettingSensorFromThreads() {
         final TestApplication app = 
mgmt.getEntityManager().createEntity(EntitySpec.create(TestApplication.class));
         final AttributeSensor<String> TEST_SENSOR = 
Sensors.newStringSensor("test.sensor");

Reply via email to