GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/727

    Fix SoftwareProcessEntityFeedRebindTest

    The test `testFeedsDoNotPollUntilManaged` failed in jenkins (see 
https://github.com/apache/brooklyn-server/pull/726#issuecomment-307579748) with 
the failure:
    ```
    java.lang.AssertionError: entity=MyServiceWithFeedsImpl{id=ghzmpwboh4}; 
attribute=Sensor: service.process.isRunning (java.lang.Boolean) expected [true] 
but found [null]
        at 
org.apache.brooklyn.entity.software.base.SoftwareProcessEntityFeedRebindTest.runFeedsDoNotPollUntilManaged(SoftwareProcessEntityFeedRebindTest.java:110)
        at 
org.apache.brooklyn.entity.software.base.SoftwareProcessEntityFeedRebindTest.testFeedsDoNotPollUntilManaged(SoftwareProcessEntityFeedRebindTest.java:68)
    ```
    
    The problem is that the sensor `SERVICE_PROCESS_IS_RUNNING` is set 
asynchronously -
     in `MyServiceWithFeeds.connectSensors`, it calls 
`connectServiceUpIsRunning`, which sets up a feed to poll the driver's 
`isRunning`. We therefore need to to use `assertAttributeEqualsEventually`, 
rather than `assertAttributeEquals`.
    
    This isn't a problem in normal production usage because the default 
behaviour of `SoftwareProcess` is to block until `driver.isRunning()` returns 
true. The fact the sensor isn't populated with true until a fraction of a 
second later isn't an issue.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server 
fix-SoftwareProcessEntityFeedRebindTest

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/727.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 #727
    
----
commit b5b7012d4c9a0be858dfa5f39f036d65d30f2f1e
Author: Aled Sage <[email protected]>
Date:   2017-06-10T17:45:26Z

    Fix SoftwareProcessEntityFeedRebindTest

----


---
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.
---

Reply via email to