@AfterGroups configuration method starts before the last test in parallel finished rerun

61 views
Skip to first unread message

Boris Karpov

unread,
Nov 26, 2021, 6:17:11 AM11/26/21
to testng-dev

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.

Log_AfterTestGroups.png

testngAfterGroups.7z

⇜Krishnan Mahadevan⇝

unread,
Nov 28, 2021, 5:02:28 AM11/28/21
to testn...@googlegroups.com
I have logged a defect to track this. 


This has got nothing to do with whether the tests run sequentially or in parallel. The "AfterGroups" configuration method right now seems to be agnostic to test retris and it always runs as soon as the test method is completed. Let's discuss this issue on the github issue.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
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.
Reply all
Reply to author
Forward
0 new messages