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 runs methods from one class in different threads, interleaves two classes in one thread #1050
Comments
+1 |
There is a Test annotation parameter : singleThreaded Will it solve the issue? |
Added the following annotation to all three classes plus the abstract class. |
I also tested making the base class concrete and making the Test classes not extend a class. |
Looks similar to #89 |
Closes testng-team#89, testng-team#1050, testng-team#1066, testng-team#1173, testng-team#1185 This PR aims at assuring that methods that fall under the below two use cases, all run on the same thread when classes are being run in parallel: * @test methods in a class are ordered by priority * @test methods have a single dependency on another method using “dependsOnMethods” attribute. The thread affinity feature is supposed to be “experimental” and it can be turned on via the JVM argument : -Dtestng.thread.affinity=true This feature is turned off by default just to ensure that we don’t have any users experiencing un-usual behavior.
Closes testng-team#89, testng-team#1050, testng-team#1066, testng-team#1173, testng-team#1185 This PR aims at assuring that methods that fall under the below two use cases, all run on the same thread when classes are being run in parallel: * @test methods in a class are ordered by priority * @test methods have a single dependency on another method using “dependsOnMethods” attribute. The thread affinity feature is supposed to be “experimental” and it can be turned on via the JVM argument : -Dtestng.thread.affinity=true This feature is turned off by default just to ensure that we don’t have any users experiencing un-usual behavior.
Closes testng-team#89, testng-team#1050, testng-team#1066, testng-team#1173, testng-team#1185 This PR aims at assuring that methods that fall under the below two use cases, all run on the same thread when classes are being run in parallel: * @test methods in a class are ordered by priority * @test methods have a single dependency on another method using “dependsOnMethods” attribute. The thread affinity feature is supposed to be “experimental” and it can be turned on via the JVM argument : -Dtestng.thread.affinity=true This feature is turned off by default just to ensure that we don’t have any users experiencing un-usual behavior.
Fixed by #1783. |
I have a TestNG suite which runs classes in parallel.
I have encountered failures because test methods which have dependencies ran in different threads.
I created a minimum reproduceable test case.
My Test classes extend an abstract test class. I don't know if this is related to the problem.
I attached a zip file with the Java source, Test.xml and pom.xml
parallelClasses.zip
EXPECTED:
FirstTest.testTwo should run in thread 11. I expect all test methods from one class to run in the same thread.
ThirdTest.test3a should run after SecondTest class finishes. I expect all test methods in a class to run before another class starts running in the same thread.
ACTUAL:
`[TestNG] Running:
C:\Users\mbullock\workspace\Test\Test.xml
thread 11 STARTING METHOD=FirstTest.testOne
thread 12 STARTING METHOD=SecondTest.test2a
thread 12 STARTING METHOD=ThirdTest.test3a
thread 12 STARTING METHOD=SecondTest.test2b
thread 11 STARTING METHOD=ThirdTest.test3b
thread 12 STARTING METHOD=FirstTest.testTwo
Critical
Total tests run: 6, Failures: 0, Skips: 0
===============================================`
The text was updated successfully, but these errors were encountered: