Closed fslev closed 4 years ago
If I change testng.xml file to run @Test methods in serial, the issue / issues from above never happen
How often is tearDownClass
invoked? Sounds like the test run finished event is emitted twice.
Added some logs inside the tearDownClass() method. It seems that is invoked only once.
In order to reproduce it easier, you can pull the code from here:
git@github.com:fslev/cucumber-utils-tutorial.git
and run it:
mvn clean test -Pprod -Dconcurrent -Dtags=@all
Thanks for the reproducer. Though I would have preferred a slightly smaller one. The additional output made it hard add see what was going on.
The problem is that while Cucumber can execute scenarios in parallel it can not execute data provider methods in parallel. Because you've set parallel="methods"
TestNG will however try to do so. This will be fixed with #1919 but for the time being I would recommend that you don't try to execute data provider methods in parallel.
Thanks !
Hi,
I have the a TestNG class for running Cucumber scenarios both serially and in parallel. It contains two @Test methods: one is for running scenarios in parallel and the 2nd is for running scenarios in serial. Test methods are executed in parallel:
TestNG class:
When all scenarios finish, the @AfterClass method is invoked in order to close the TestNGCucumberRunner. Then, the following error is thrown:
But sometimes, when I run the code again, I get a NPE:
This is even stranger, because this is the only stacktrace I get.
Should I create two separate runners in this case, for each test method ? The code from above is actually taken from the cucumber-testng module: ScenariosInDifferentGroupsTest Cheers