Open mstrahinski opened 2 years ago
@mstrahinski
This looks like a duplicate of https://github.com/cbeust/testng/issues/2359
This was recently fixed and the fix should be available in 7.6.0
Can you please try using the SNAPSHOT version 7.6.0-SNAPSHOT and confirm?
You can browse the jar here https://oss.sonatype.org/content/repositories/snapshots/org/testng/testng/7.6.0-SNAPSHOT/
Refer to this article to learn how to consume snapshots https://stackoverflow.com/a/7717234
TestNG Version
Latest version: 7.5
Expected behavior
When u have multiple tests with @Test(group="group") methods and one @BeforeGroups(value = "group", alwaysRun = true) in a multi-threaded run with 4 threads, all of the @Test executions should start AFTER the @BeforeGroup method finishes its execution.
Actual behavior
Currently in multi-threaded execution with 4 threads the @BeforeGroups method starts, however in another thread also the execution of a @Test starts in the same time and does NOT wait for @BeforeGroups to finish before it starts.
Is the issue reproducible on runner?
Test case sample
In a Maven project with latest TestNG(7.5) and latest maven-surefire-plugin(3.0.0-M6) have that code in a class named BeforeGroupsTest.java:
in your Terminal run the following Maven command:
mvn clean test -Dgroups="group" -Dthreads=4
you will observe a result like:which clearly shows that the the "first test" did not wait for the @BeforeGroups to finish its execution before starting.
P.S. Have found that reporting under - https://github.com/cbeust/testng/issues/1859 , however I'm filing it as a new bug as I have just experienced it and looks like no fix was applied after that issues was filed in the past.