Github user neykov commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/452#discussion_r89083193
--- Diff:
core/src/test/java/org/apache/brooklyn/core/entity/lifecycle/ServiceStateLogicTest.java
---
@@ -281,6 +291,35 @@ public void testQuorumWithStringStates() {
EntityAsserts.assertAttributeEqualsContinually(cluster,
Attributes.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
}
+ public static class CountingComputeServiceState extends
ComputeServiceState {
+ AtomicInteger cntCalled = new AtomicInteger();
+ AtomicInteger cntCalledWithNull = new AtomicInteger();
+
+ public CountingComputeServiceState() {}
+
+ @Override
+ public void onEvent(SensorEvent<Object> event) {
+ cntCalled.incrementAndGet();
+ if (event == null) {
+ cntCalledWithNull.incrementAndGet();
+ }
+ super.onEvent(event);
+ }
+ }
+
+ @Test
+ public void testServiceStateNotCalledExplicitly() throws Exception {
--- End diff --
Wasn't able to come up with a deterministic test to observe the failure
case. Instead I'm asserting that the cause is not happening any more.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---