Parallel test run is not working in 6.13.1
Example test class
public class ThreadCountTest {
@Test
public void test1(){
System.out.println(Thread.currentThread().getId());
}
@Test
public void test2(){
System.out.println(Thread.currentThread().getId());
}
@Test
public void test3(){
System.out.println(Thread.currentThread().getId());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Thread count" parallel="methods" thread-count="3">
<test name="Test">
<classes>
<class name="onetech.ThreadCountTest"/>
</classes>
</test>
</suite>
TestNG - 6.11 output
13
14
15
(Each test is launched in a separate thread which is indicated by unique thread id)
TestNG - 6.13.1 output
1
1
1
(Every test is launched in the same thread)
Is the issue reproductible on runner?
- [ ] Shell
- [x] Maven
- [ ] Gradle
- [ ] Ant
- [ ] Eclipse
- [x] IntelliJ
- [ ] NetBeans
Test case sample
See above
@da-yaroslav-orel - Thanks for submitting this issue. We will look into it.
In the meantime, if you were to use a suite xml file such as the one below, you should see your tests run in parallel.
<suite name="Thread count" parallel="methods" thread-count="3" verbose="3">
<test name="Test" parallel="methods" thread-count="3">
<classes>
<class name="foo.ThreadCountTest"/>
</classes>
</test>
</suite>
Note That I have merely added the parallel and the thread-count attributes at the <test> level as well.
This seems to have gotten introduced only with TestNG 6.13.1. Until 6.12 we are good.
The parallel run does not work on 6.14.2
@tsheva
The latest released version of TestNG is 6.14.3. So please do the following:
- Try reproducing your issue using TestNG 6.14.3.
- If (1) fails, please also try using TestNG 7.0.0-SNAPSHOT [ This is the upcoming version that will get eventually released ]
- If (2) also fails, please file a new bug, with a sample (standalone with no external library references) that can be used to reproduce the problem.