See an example in the attached project. Unpack the archive, run mvn test .
We have a group of two tests running in separate threads. One of the tests starts rerun before and ends rerun after the other test finished successfully. In this case the @AfterGroups configuration method runs shortly after the successful test is finished, before the retried test ends rerun. Such a behavior of testng seems incorrect.
There are four tests in three groups, the groups are running subsequently.
Initial Group consists of TestCase1.
Main Group consists of TestCase2 and TestCase3 starting simultaneously in separate threads. TestCase2 is skipped and starts rerun, then TestCase3 has finished successfully. @AfterGroups configuration method runs at this moment, before TestCase2 ends rerun, see log snippet below.
Final Group consists of TestCase4.
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-dev/c78b487c-2684-429d-b3d7-6f2f053d03f6n%40googlegroups.com.