brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From geomacy <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #464: Avoid uncaught exceptions in testOnDoneCa...
Date Thu, 24 Nov 2016 17:40:44 GMT
GitHub user geomacy opened a pull request:

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

    Avoid uncaught exceptions in testOnDoneCallback

    All tasks hit the listener, including tasks for starting the application
    etc, so before this change the test logged errors as below. These fail the
    assertion on the name, giving the messages below.
    
    Change the test to avoid the assertion on name and to explicitly check for
    the two tasks we want to find.
    
    Note had to add the synchronization on 'completedTasks' as without it the
    test would occasionally fail (~ one time in a dozen); as the state in the
    exec thread wouldn't necessarily be propagated to the main thread without
    synchronization.
    
    2016-11-24 10:02:33,097 INFO  TESTNG INVOKING: "Surefire test" - org.apache.brooklyn.core.mgmt.internal.EntityExecutionManagerTest.testOnDoneCallback()
    2016-11-24 10:02:33,099 INFO  TESTNG PASSED: "Surefire test" - org.apache.brooklyn.core.mgmt.internal.EntityExecutionManagerTest.testOnDoneCallback()
finished in 2 ms
    2016-11-24 10:02:33,100 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - @AfterMethod
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown()
    2016-11-24 10:02:33,104 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-4
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,105 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-3
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,105 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-6
    java.lang.AssertionError: expected [foo] but found [[]]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,105 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-0
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,115 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-9
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,115 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-2
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,115 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-10
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,116 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-7
    java.lang.AssertionError: expected [foo] but found [[[]]]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]

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

    $ git pull https://github.com/geomacy/brooklyn-server test-on-done-callback

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

    https://github.com/apache/brooklyn-server/pull/464.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 #464
    
----
commit cf72ca08ed4fbd733fdd8810a78b642bb836b394
Author: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Date:   2016-11-24T14:52:28Z

    Avoid uncaught exceptions in test.
    
    All tasks hit the listener, including tasks for starting the application
    etc, so before this change the test logged errors as below. These fail the
    assertion on the name, giving the messages below.
    
    Change the test to avoid the assertion on name and to explicitly check for
    the two tasks we want to find.
    
    Note had to add the synchronization on 'completedTasks' as without it the
    test would occasionally fail (~ one time in a dozen); as the state in the
    exec thread wouldn't necessarily be propagated to the main thread without
    synchronization.
    
    2016-11-24 10:02:33,097 INFO  TESTNG INVOKING: "Surefire test" - org.apache.brooklyn.core.mgmt.internal.EntityExecutionManagerTest.testOnDoneCallback()
    2016-11-24 10:02:33,099 INFO  TESTNG PASSED: "Surefire test" - org.apache.brooklyn.core.mgmt.internal.EntityExecutionManagerTest.testOnDoneCallback()
finished in 2 ms
    2016-11-24 10:02:33,100 INFO  TESTNG INVOKING CONFIGURATION: "Surefire test" - @AfterMethod
org.apache.brooklyn.core.test.BrooklynMgmtUnitTestSupport.tearDown()
    2016-11-24 10:02:33,104 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-4
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,105 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-3
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,105 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-6
    java.lang.AssertionError: expected [foo] but found [[]]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,105 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-0
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,115 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-9
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,115 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-2
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,115 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-10
    java.lang.AssertionError: expected [foo] but found [null]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]
    2016-11-24 10:02:33,116 ERROR Uncaught exception in thread brooklyn-execmanager-AxEAJeYA-7
    java.lang.AssertionError: expected [foo] but found [[[]]]
    	at org.testng.Assert.fail(Assert.java:94) ~[testng-6.9.10.jar:na]

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message