Replies: 3 comments
-
As discussed on SO with @mpkorstanje, it's not possible at the moment and requires additional development on JUnit5 side.
|
Beta Was this translation helpful? Give feedback.
-
To express this in JUnit Jupiter terms, this would be equivalent to running at most 2 test methods per class in parallel while still running all classes in parallel. |
Beta Was this translation helpful? Give feedback.
-
This discussion was trasfered into the issue #3524 |
Beta Was this translation helpful? Give feedback.
-
I use cucumber with junit.
I have several feature files. Each feature file is designed to test one application instance: A.feature, B.feature, C.feature. Each feature file contains one scenario template(outline) with N examples (usually more than 10).
Application instances are independet from each other. And each application instance can process input data in M threads, usually 2. So it does not make sense to run scenarios for particular application instance in more than M (2) threads, because it will lead to flaky tests and unstable execution time.
In the same time running scenarios for one instance (with execution-mode.feature=same_thread) in one thread can take much time.
What do I want to achieve:
Run feature files in parallel.
Run scenarios from particular feature file in parallel, but limited to 2 simultaneously running scenarios.
Overall threads limit should be equal to CPUs count or fixed pool size, let's say 6 (parallel.config.fixed.max-pool-size=6)
Example:
Being executed simultaneusly:
Waiting in the queue:
Graphical visualisation for better understanding:
I suppose that it may be achieved using CustomStrategy:
https://github.com/cucumber/cucumber-jvm/tree/main/cucumber-junit-platform-engine#parallel-execution
But it could be tricky especially with the fact that I do not understand for now, at what point of time these properties are being set. And could they be changed dynamically (another words based on feature files configuration, not only pom.xml).
My idea was to try using tags on scenario level, something like @feature=A, @feature=B etc to limit parallelism for pool of scenarios. But I'm on the beginning of my journey, so need an advice if it's possible or not.
Question on SO: https://stackoverflow.com/questions/77388756/configure-parallelism-on-features-and-scenarios-level-in-the-same-time-cucumbe
Beta Was this translation helpful? Give feedback.
All reactions