-
Task
-
Resolution: Done
-
Major
-
5.1.3.CR1
-
None
TestNG will start a method has a @Test(timeout = x) annotation in a separate thread. Because of this, we don't have access to the test name and we have to rely on the method name only to provide a unique identifier for the cluster.
This approach breaks down when we have a test class extending another, as all the test methods in the parent class are now duplicated. E.g. StateTransferClassLoaderFunctionalTest extends StateTransferFunctionalTest, which leads to failures like this in the test suite:
Cache at address testSTWithWritingNonTxThread-55146 had 3 members; expecting 2. Members were (testSTWithWritingNonTxThread-55146, testSTWithWritingNonTxThread-61383, testSTWithWritingNonTxThread-7922)
The solution is to force the user to provide the name of the test, e.g. by calling a method backgroundTestStarted(this) at the start of each method with a @Test(timeout = x) annotation. As a bonus, this will make it easier to search for the logs of such test methods.