cbeust/testng — Issue #153: Wrong thread names in method runs reports
Author: sergebg
Created: 2011-12-30 21:51:05+00:00
State: open

A test with 2 @Test methods and one @BeforeMethod. When it is executed with parallel = true, reported thread names are incorrect. Code example (only class body):

@BeforeMethod public void init() {
Reporter.log(Thread.currentThread().toString());
}
@Test public void test1() {}
@Test public void test2() {}

Lines from report (here threads are correct):

Thread[pool-2-thread-1,5,main]
Thread[pool-2-thread-2,5,main]

And this information is extracted from the "Method runs, sorted chronologically" report (methods.html):

11/12/31 01:30:26	0	>>init	pool-2-thread-1@1272266587
11/12/31 01:30:26	-1	>>init	pool-2-thread-1@1272266587
11/12/31 01:30:26	6	test1	pool-2-thread-1@1272266587
11/12/31 01:30:26	6	test2	pool-2-thread-2@489854530

In the report for the both invocations of init() method the same thread is shown.