question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parallel classes runs methods from one class in different threads, interleaves two classes in one thread

See original GitHub issue

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 ===============================================`

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dr29bartcommented, Jun 12, 2016

There is a Test annotation parameter : singleThreaded http://testng.org/doc/documentation-main.html#annotations

Will it solve the issue?

0reactions
krmahadevancommented, May 17, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found