Skip to content
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

How cucumber.execution.parallel.enabled works with cucumber.execution.order? #2974

Closed
TrueJacobG opened this issue Feb 5, 2025 · 2 comments
Labels
❓ question Consider using support forums: https://cucumber.io/tools/cucumber-open/support

Comments

@TrueJacobG
Copy link

Requirements:

cucumber.execution.parallel.enabled=true
cucumber.execution.parallel.config.strategy=fixed
cucumber.execution.parallel.config.fixed.max-pool-size=5

cucumber.execution.order=lexical

platform: JUnit 5


I believe we can assume that tests will start in alphabetical order on each thread. However, while we cannot assume that tests will both start and finish in alphabetical order overall, we can assume that if we examine all tests performed on, lets say, thread 1, they were started in alphabetical order, right?

@mpkorstanje mpkorstanje added the ❓ question Consider using support forums: https://cucumber.io/tools/cucumber-open/support label Feb 5, 2025
@mpkorstanje
Copy link
Contributor

mpkorstanje commented Feb 5, 2025

At the moment configuring the execution order isn't supported by the Cucumber JUnit Platform Engine. You can see that the property isn't listed in the supported configuration properties.

This may become supported once the next version of JUnit is released and I can finish #2835.

The default ordering is lexical by feature file uri.

The Cucumber JUnit Platform Engine uses the JUnit Platform for parallel execution and the current implementation uses a ForkJoinPool. This pool utilized work stealing. As such no guarantees can be made about ordering or even the thread on which a scenario or example is executed.

The exception to this are the cucumber.execution.execution-mode.feature property which makes it possible to run all scenarios and examples in a feature on the same thread.

Likewise using exclusive resources has a similar effect. Though mostly as a side effect of the current JUnit Platform.

There is also the more generic possibility in the JUnit Platform to configure tests to run on the same thread as their sublings, but that hasn't been implemented in Cucumber yet

Edit: oops, wrong button

@mpkorstanje mpkorstanje reopened this Feb 5, 2025
@mpkorstanje mpkorstanje changed the title [QUESTION] How cucumber.execution.parallel.enabled works with cucumber.execution.order? How cucumber.execution.parallel.enabled works with cucumber.execution.order? Feb 5, 2025
@TrueJacobG
Copy link
Author

Thank you for the information! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question Consider using support forums: https://cucumber.io/tools/cucumber-open/support
Projects
None yet
Development

No branches or pull requests

2 participants