brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorb...@apache.org
Subject [5/6] brooklyn-server git commit: SoftwareProcessEntityTest.testDoubleStopEntity - add some troubleshooting checks
Date Fri, 24 Mar 2017 18:46:02 GMT
SoftwareProcessEntityTest.testDoubleStopEntity - add some troubleshooting checks

Failed with the following exception, but not obvious why:

java.lang.AssertionError: entity=EmptySoftwareProcessImpl{id=i5jf7l77wu}; attribute=Sensor:
service.state (org.apache.brooklyn.core.entity.lifecycle.Lifecycle) expected [stopped] but
found [stopping]
    at org.apache.brooklyn.test.Asserts.fail(Asserts.java:758)
    at org.apache.brooklyn.test.Asserts.failNotEquals(Asserts.java:148)
    at org.apache.brooklyn.test.Asserts.assertEquals(Asserts.java:470)
    at org.apache.brooklyn.core.entity.EntityAsserts.assertAttributeEquals(EntityAsserts.java:58)
    at org.apache.brooklyn.entity.software.base.SoftwareProcessEntityTest.testDoubleStopEntity(SoftwareProcessEntityTest.java:496)


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

Branch: refs/heads/master
Commit: dc2eb153488bb3974db7f7707db2de69089c5c36
Parents: 363874e
Author: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Authored: Fri Mar 24 17:19:55 2017 +0200
Committer: Svetoslav Neykov <svetoslav.neykov@cloudsoftcorp.com>
Committed: Fri Mar 24 17:19:55 2017 +0200

----------------------------------------------------------------------
 .../entity/software/base/SoftwareProcessEntityTest.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/dc2eb153/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessEntityTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessEntityTest.java
b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessEntityTest.java
index b1564e9..3fa464c 100644
--- a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessEntityTest.java
+++ b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/SoftwareProcessEntityTest.java
@@ -481,7 +481,10 @@ public class SoftwareProcessEntityTest extends BrooklynAppUnitTestSupport
{
                     assertTrue(loc.isBlocked());
                 }
             });
-    
+
+            assertEquals(ServiceStateLogic.getExpectedState(entity), Lifecycle.STOPPING);
+            EntityAsserts.assertAttributeEquals(entity, Attributes.SERVICE_STATE_ACTUAL,
Lifecycle.STOPPING);
+
             // Subsequent stops will end quickly - no location to release,
             // while the first one is still releasing the machine.
             final Task<Void> secondStop = entity.invoke(Startable.STOP, ImmutableMap.<String,
Object>of());;
@@ -492,7 +495,10 @@ public class SoftwareProcessEntityTest extends BrooklynAppUnitTestSupport
{
                 }
             });
     
-            // Entity state is STOPPED even though first location is still releasing
+            // Entity state is supposed to be STOPPED even though first location is still
releasing. This is because the second
+            // release completed successfully. It's debatable whether this is the right behaviour
- we could be calling the STOP
+            // effector exactly because the first call is blocked. The test is asserting
the current behaviour.
+            assertEquals(ServiceStateLogic.getExpectedState(entity), Lifecycle.STOPPED);
             EntityAsserts.assertAttributeEquals(entity, Attributes.SERVICE_STATE_ACTUAL,
Lifecycle.STOPPED);
             Asserts.succeedsContinually(new Runnable() {
                 @Override


Mime
View raw message