Parallel classes runs methods from one class in different threads, interleaves two classes in one thread
See original GitHub issueI 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 ===============================================`
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
There is a Test annotation parameter : singleThreaded http://testng.org/doc/documentation-main.html#annotations
Will it solve the issue?
Fixed by https://github.com/cbeust/testng/pull/1783.