Hi,

While tying up the loose ends in our maven conversion the following problem
occurs when use TestNG with threadPoolSize > 1:

----build.gradle----
apply plugin: 'java'

sourceCompatibility = 1.6

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'org.testng', name: 'testng', version: '6.+'
}

test {
    useTestNG()
}
----build.gradle----

--- pretty minimal testcase ---
import org.testng.annotations.Test;
import org.testng.Assert;

public class ThreadedTest {
    @Test(threadPoolSize = 3, invocationCount = 1000)
    public void test() {
        Assert.assertTrue(true);
    }
}
--- pretty minimal testcase ---

This gives loads of output like:

:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:testFailed to dispatch message
org.gradle.messaging.dispatch.MethodInvocation@1c71474e.
org.gradle.messaging.dispatch.DispatchException: Failed to dispatch message
org.gradle.messaging.dispatch.MethodInvocation@1c71474e.
        at
org.gradle.messaging.dispatch.ExceptionTrackingDispatch.dispatch(ExceptionTrackingDispatch.java:34)
        at
org.gradle.messaging.dispatch.AsyncDispatch.dispatchMessages(AsyncDispatch.java:129)
        at
org.gradle.messaging.dispatch.AsyncDispatch.access$000(AsyncDispatch.java:33)
        at
org.gradle.messaging.dispatch.AsyncDispatch$1.run(AsyncDispatch.java:69)
        at
org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:679)
Caused by: java.lang.IllegalArgumentException: Received a completed event
for test with unknown id '1.5'.
        at
org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.completed(StateTrackingTestResultProcessor.java:48)
        at
org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.completed(AttachParentTestResultProcessor.java:51)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at
org.gradle.messaging.dispatch.ExceptionTrackingDispatch.dispatch(ExceptionTrackingDispatch.java:32)
        ... 7 more
Test ThreadedTest FAILED
.... etc....

Repeats with varying id's

And ends with:

Caused by: java.lang.IllegalArgumentException: Received a completed event
for test with unknown id '1.1233'.
        at
org.gradle.api.internal.tasks.testing.results.StateTrackingTestResultProcessor.completed(StateTrackingTestResultProcessor.java:48)
        at
org.gradle.api.internal.tasks.testing.results.AttachParentTestResultProcessor.completed(AttachParentTestResultProcessor.java:51)
        at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at
org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at
org.gradle.messaging.dispatch.ExceptionTrackingDispatch.dispatch(ExceptionTrackingDispatch.java:32)
        ... 7 more
761 tests completed, 66 failures


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
Cause: Received a failure event for test with unknown id '1.5'.

I might hazard the guess that I may log a bug ? Also note that tests get
lost, there should be 1000.

Cheers,

Ric

Reply via email to