Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel="classes" Tests not running in parallel mode with gradle #1701

Closed
1 of 7 tasks
pgsung opened this issue Feb 19, 2018 · 4 comments
Closed
1 of 7 tasks

parallel="classes" Tests not running in parallel mode with gradle #1701

pgsung opened this issue Feb 19, 2018 · 4 comments

Comments

@pgsung
Copy link

pgsung commented Feb 19, 2018

TestNG Version

Note: only the latest version is supported
6.14.2

Expected behavior

Tests should run in the parallel mode with gradle 4.3.1 with testng.xml at https://github.com/pgsung/testng-bug/blob/master/src/test/resources/testng.xml
and source code at https://github.com/pgsung/testng-bug
test classes https://github.com/pgsung/testng-bug/tree/master/src/test/java/parallel/test
, thread ids should be different.

[RemoteTestNG] detected TestNG version 6.14.2
11
12
10

===============================================
content-backoffice-ci-uitest Suite
Total tests run: 3, Failures: 0, Skips: 0

Actual behavior

Tests not running in parallel mode with gradle 4.3.1

content-backoffice-ci-uitest Suite > thread-test > parallel.test.Test1.runTests STANDARD_OUT
    10
Running test: Test method runTests(parallel.test.Test2)

content-backoffice-ci-uitest Suite > thread-test > parallel.test.Test2.runTests STANDARD_OUT
    10
Running test: Test method runTests(parallel.test.Test3)

content-backoffice-ci-uitest Suite > thread-test > parallel.test.Test3.runTests STANDARD_OUT
    10

Is the issue reproductible on runner?

  • Shell
  • Maven
  • Gradle (same behavior with gradle 4.5.1)
  • Ant
  • Eclipse
  • IntelliJ
  • NetBeans

Eclipse runner version TestNG 6.13.0.201712040650 is actually running fine.

Test case sample

Please, share the test case (as small as possible) which shows the issue

  1. clone the repo at https://github.com/pgsung/testng-bug
  2. run the test with command ./gradlew clean test

Workaround: switch back to 6.11

@pgsung pgsung changed the title Tests not running in parallel mode with gradle parallel="classes" Tests not running in parallel mode with gradle Feb 19, 2018
@krmahadevan
Copy link
Member

This seems to be an issue with Gradle. I am not that well versed with Gradle. But my debugging seems to suggest that when we hit the flow here the parallel mode is getting reset back to null. This issue has been fixed in TestNG as of 6.14.2. You can try right clicking on your testng.xml suite file in your project and running it. You should see different thread ids.

To get past this in gradle as well, just add the parallel mode to your <test> tag as well and try again. You should be fine.

@juherr - Any idea on how to get this sorted out in gradle ? Should we ask @pgsung to raise a bug against gradle and follow it up there, while we close this issue here ?

@juherr
Copy link
Member

juherr commented Feb 20, 2018

I think the gradle issue tracker will be a better location.

@krmahadevan
Copy link
Member

@pgsung - Please raise an issue here to get this addressed. Closing this off, since TestNG doesn't seem to be cause of the problem.

@pgsung
Copy link
Author

pgsung commented Feb 20, 2018

Thank you guys. Filed the issue to gradle at gradle/gradle#4457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants