Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-1532

Gradle throwing error when trying to execute parallel functional test with Selenium Grid and testNG

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.0-milestone-4

Description

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.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    sample.zip
    03/Jun/11 4:39 AM
    1 kB
    Szczepan Faber
    1. File
      build.gradle 0.2 kB
    2. File
      src/.DS_Store 6 kB
    3. Java Source File
      src/test/java/SomeTest.java 0.2 kB
    Download Zip
    Show
    Zip Archive
    sample.zip
    03/Jun/11 4:39 AM
    1 kB
    Szczepan Faber

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Szczepan Faber added a comment - 03/Jun/11 4:39 AM

very tiny project that reproduces the problem

Show
Szczepan Faber added a comment - 03/Jun/11 4:39 AM very tiny project that reproduces the problem
Szczepan Faber made changes - 03/Jun/11 4:39 AM
Field Original Value New Value
Attachment sample.zip [ 10214 ]
Hide
Create a new review for changeset 96539748ac6965c5cea7b0a11d6d7064ad7fde4f
Szczepan Faber <szczepiq@gmail.com> submitted changeset 96539748ac6965c5cea7b0a11d6d7064ad7fde4f to RB_1.0-milestone-5 in Gradle (3 files) - 18/Jun/11 10:36 AM

GRADLE-1532 Fixed the issue with TestNG parallel tests. The problem was caused because method name was used to identify the test id. When someone used TestNG's feature @Test(invocationCount = 2, threadPoolSize = 2) then just the method name was not enough for identification. My fix is using the ITestResult from TestNG as an identifier for internal use in a hashmap. Also I did very simple refactoring that should help in debugging similar issues in future.

  • subprojects/integ-test/src/integTest/groovy/org/gradle/integtests/testng/TestNGIntegrationTest.groovy (+36 -0)
    • View diff to previous
    • View full source
    • View file history
    • Download raw file
  • subprojects/plugins/src/main/groovy/org/gradle/api/internal/tasks/testing/results/StateTrackingTestResultProcessor.java (+5 -3)
    • View diff to previous
    • View full source
    • View file history
    • Download raw file
  • subprojects/plugins/src/main/groovy/org/gradle/api/internal/tasks/testing/testng/TestNGTestResultProcessorAdapter.java (+135 -132)
    • View diff to previous
    • View full source
    • View file history
    • Download raw file
Show
Create a new review for changeset 96539748ac6965c5cea7b0a11d6d7064ad7fde4f
Szczepan Faber <szczepiq@gmail.com> submitted changeset 96539748ac6965c5cea7b0a11d6d7064ad7fde4f to RB_1.0-milestone-5 in Gradle (3 files) - 18/Jun/11 10:36 AM
Hide
Permalink
Szczepan Faber added a comment - 18/Jun/11 10:37 AM

Fixed in master

Show
Szczepan Faber added a comment - 18/Jun/11 10:37 AM Fixed in master
Szczepan Faber made changes - 18/Jun/11 10:37 AM
Resolution Fixed [ 1 ]
Fix Version/s 1.0-milestone-4 [ 10060 ]
Status Open [ 1 ] Resolved [ 5 ]
Daz DeBoer made changes - 03/Aug/11 3:29 PM
Workflow jira [ 12954 ] jira with pivotal tracker [ 14369 ]
Luke Daley made changes - 03/Jan/13 5:08 AM
Status Resolved [ 5 ] Closed [ 6 ]
Workflow jira with pivotal tracker [ 14369 ] jira with pivotal tracker (no resolved, only closed) [ 16286 ]
Luke Daley made changes - 04/Jan/13 5:09 AM
Status Closed [ 6 ] Resolved [ 5 ]
Workflow jira with pivotal tracker (no resolved, only closed) [ 16286 ] Copy of jira with pivotal tracker (no closed, only resolved) [ 18959 ]
Unable to get TeamCity builds: No active plugin license is found! Please visit http://stiltsoft.com/teamcity for details

People

  • Assignee:
    Unassigned
    Reporter:
    Asmita Vaidya
Vote (1)
Watch (1)

Dates

  • Created:
    12/May/11 9:24 AM
    Updated:
    04/Jan/13 5:09 AM
    Resolved:
    18/Jun/11 10:37 AM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.