[
https://issues.apache.org/jira/browse/BROOKLYN-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15319629#comment-15319629
]
ASF GitHub Bot commented on BROOKLYN-291:
-----------------------------------------
GitHub user aledsage opened a pull request:
https://github.com/apache/brooklyn-server/pull/187
BROOKLYN-291: don’t override manually-set service.isUp
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aledsage/brooklyn-server fix/BROOKLYN-291
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-server/pull/187.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #187
----
commit 00a557f04ceb8c7a2f262e54ca622e6ead6b7a80
Author: Aled Sage <[email protected]>
Date: 2016-06-07T22:44:47Z
BROOKLYN-291: don’t override manually-set service.isUp
----
> Manually setting service.isUp is overwritten by enricher (causing
> non-deterministic test failures)
> --------------------------------------------------------------------------------------------------
>
> Key: BROOKLYN-291
> URL: https://issues.apache.org/jira/browse/BROOKLYN-291
> Project: Brooklyn
> Issue Type: Bug
> Affects Versions: 0.9.0
> Reporter: Aled Sage
>
> If one creates an entity and explicitly sets its service.isUp to true, then
> the default enrichers can override this value to remove it. This is because
> it is executing concurrently, and if service-up-indicators is null then it
> removes the service.isUp sensor value!
> A similar thing happens for the service.state sensor.
> This is non-deterministic, but can be demonstrate with this simple test:
> {noformat}
> for (int i = 0; i < 100; i++) {
> TestEntity entity = app.addChild(EntitySpec.create(TestEntity.class));
> entity.sensors().set(TestEntity.SERVICE_UP, true);
> entity.sensors().set(TestEntity.SERVICE_STATE_ACTUAL, Lifecycle.RUNNING);
> Thread.sleep(10);
> assertEquals(entity.sensors().get(TestEntity.SERVICE_UP), Boolean.TRUE);
> assertEquals(entity.sensors().get(TestEntity.SERVICE_STATE_ACTUAL),
> Lifecycle.RUNNING);
> }
> {noformat}
> Most entities don't explicitly set the service.isUp, so it has not been a
> problem in production systems. However, it does impact tests - it is the
> likely cause of many non-deterministic test failures.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)