I am using TestNG with Gradle to run functional tests in parallel with
Selenium Grid. I was getting this error while trying to execute two
test classes in parallel.
Failed 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$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.IllegalArgumentException: Received a completed
event for test with unknown id '1.8'.
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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
Initially I didn't know what was going on. Later I noticed two methods
in each class had same name. When I changed the name of one of the
methods(that had same name as in other class) in one class, the tests
ran in parallel without any error.
It has to be problem with either Gradle or TestNG. It should be able to handle same method names in two different classes.
|