-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Parallel Execution of Tests #2512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Parallel execution in the Cucumber JUnit Platform Engine is facilitated by JUnit 5. Lines 47 to 55 in bb05e25
So this looks like an instance of junit-team/junit5#1858. Presumably this will be fixed in next version of JUnit with junit-team/junit5#2792. As the JUnit team uses engagement as a proxy for importance it would be worthwhile to verify and acknowledge this MR does indeed solve your problem and otherwise show interest by upvoting these issues. As a workaround it may be possible to wrap whatever object creates the additional threadpool (e.g. a webdriver or kubernet client) in an object pool to ensure only a limited number of instances are ever created in total without depending on the exact number of threads. |
Closing this. There is little to be done by Cucumber. |
Use a custom parallel execution configuration strategy (don't forget to implement the new getSaturatedPredicate method - Junit 1.9.0) junit-platform.properties
This way, you will always have a fixed number of threads running your scenarios. |
Should probably add that to the docs. |
Hi guys, I've just run into the same issue here with all tests running at once even after setting the max thread to 4. I was hoping that I might try @fslev's solution but to no avail. Would it be possible to get a bit more information on how to integrate this custom parallel class with my tests as it seems to have no effect when adding it my project or might this be added to the docs anytime soon? Also would you be opposed to the idea of reverting to Junit4 to get the parallel execution working, if this is an issue with Junit5? |
You would have to set in
This follows the same pattern as JUnit Jupiter: https://junit.org/junit5/docs/current/user-guide/#writing-tests-parallel-execution-config.
This doesn't quite parse. Currently you can use either the |
I appreciate the response although that doesn't really help much, as I said I've already tried this. I set it in the |
Can you provide a bit more information about what appears to be broken when a strategy with the saturate predicate is provided? Either that or provide an MCVE.
On top of mind, JUnit 4 biggest draw back with respect to parallel execution is that it is limited to executing feature files rather then scenarios in parallel and because of that not very efficient. Other then that I can't possibly make any statements about what problems you may encounter in your context. |
@thomasrapadmi I think I may have found your problem somewhat by accident. If you are on Java 8, it is not possible to configure the max pool size of the fork join pool used by JUnit. So the custom strategy will not work. Consider upgrading your Java version. |
Also, a new Junit version (5.10.0) will soon be available, which uses saturated thread pool by default: |
π What did you see?
When Running Cucumber Tests with parallel strategy as fixed and parallelism set to 4. I am seeing more than 8 tests running in parallel.
β What did you expect to see?
I should see only 4 tests to run in parallel mode.
π¦ Which tool/library version are you using?
I am using cucumber-junit-platform-engine with version 7.2.3
π¬ How could we reproduce it?
we need to enable parallel execution and set the parallel execution strategy to fixed.
Steps to reproduce the behavior:
π Any additional context?
This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: