[BROOKLYN-356] Transformer value resolver test#365
Conversation
361574c to
1f82109
Compare
| invokeCallback(flags.get("newTaskStartCallback"), task); | ||
| } | ||
|
|
||
| private void jitterThreadStart(Task<?> task) { |
There was a problem hiding this comment.
Great idea!
I wonder if we should make it non-static so it can be set by a test, and unset in its tearDown method. But let's go with static. For now, we can use it by setting the system property when doing mvn clean install.
Once we've fixed (most of) the failures that it exposes, then we can think about enabling it for some tests in jenkins - for regression testing purposes. But we want jenkins to be deterministic!
| Throwable error = null; | ||
| String oldThreadName = Thread.currentThread().getName(); | ||
| try { | ||
| if (RENAME_THREADS) { |
There was a problem hiding this comment.
I presume this is removed from here because internalBeforeStart() and internalAfterEnd() are already doing the thread renaming? If so, then great.
There was a problem hiding this comment.
Correct. Details in the commit message:
Remove duplicate thread renaming
The code in beforeStartAtomicTask overrides the value set here. Keeping the other one as it's called for scheduled tasks as well.
| } | ||
|
|
||
| @Test(groups={"Integration", "Broken"}, invocationCount=10) | ||
| public void testTransformerResolvesResolvableValuesIntegration() { |
There was a problem hiding this comment.
Nice test. Without the jitter, I ran it with invocationCount=100 and it failed 2 out of 100 times with errors like:
java.lang.AssertionError: entity=Application[s01l91es]; attribute=Sensor: port.transformed (java.lang.String) expected [10889] but found [null]
| testTransformerResolvesResolvableValues(START_PORT, 200); | ||
| } | ||
|
|
||
| @Test(groups={"Integration", "Broken"}, invocationCount=10) |
There was a problem hiding this comment.
Worth including a comment above the test that points people to https://issues.apache.org/jira/browse/BROOKLYN-356
|
Jenkins build failure looks unrelated: when building "Brooklyn CAMP REST API", got It was in the middle of invoking We should (separately) investigate Unfortunately we don't have the "brooklyn gc" logging to tell us about the memory usage over time (it's logged at debug). But then for all tests except that one, the test would complete within one minute so we'd have deleted the managementContext before the brooklynGC did any logging. Maybe we want something like the |
|
@neykov looks very good to me. A couple of extremely minor things relating to this PR (the comment, and confirming about the thread renaming). Can you kick off the jenkins build again, and then merge this? |
|
@neykov previous build failure here could well be fixed by #368 - our Once that PR is confirmed to work in jenkins (including checking its stdout that the leak-detector really executed) then I'll merge #368). |
Useful for troubleshooting/testing concurrency related code.
The code in beforeStartAtomicTask overrides the value set here. Keeping the other one as it's called for scheduled tasks as well.
1f82109 to
670f83d
Compare
|
Addressed comments and kicked off another build. |
corewith this results in a handful of failures. Similar problems are very apparent on the windows builds where the machines have a single CPU and are frequently failing. I'd enable this by default for testing only if it wasn't slowing the tests to a craw.Tests are marked as
Brokenbecause there's no fix available forBOOKLYN-356yet so they might fail builds. The tests are otherwise fully implemented/working.