When parallelizings tests using testNG, tests in a class do not get executed in the same thread
问题 testng.xml: <suite name="Default Suite" parallel="classes" thread-count="3"> <test name="example"> <classes> <class name="ExampleTest"/> <class name="ExampleTest2"/> </classes> </test> </suite> test : @Test(singleThreaded = true) public class ExampleTest { @Test public void firstTest() { // first test } @Test(dependsOnMethods = "firstTest") public void secondTest() { // second test depends from first test } } tests run in three Threads, but the first test is in one thread, and the second in