You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like concurrent testing, but only 4 tests to run at a time. If I set runner.parallel.enabled I get the former. Using .fixed does not fix the latter.
Process process = processBuilder.start();
process.waitFor();
When my tests hit that point, the test framework or the executor (not sure) admits more tests than the fixed(4) limit I tried to specify.
FWIW I'd guess what's happening is that waitFor is doing a yield and allowing the executor to run something else until the OS comes back with some I/O.
Expected behavior
4 tests are run.
Fixed parallelism of tests should always limit the number of inflight tests.
It seems to currently be too tied to executors and not enough to the test framework actually limiting inflight tests.
Listen to your own words, as you said the important thing already yourself. :-)
You are not configuring a "fixed amount of tests", you are configuring a "fixed parallelity" which by far is not the same.
Also this is nothing that Spock influences, this is managed by JUnit platform for which we are just an engine.
Besides that, here even when using a Java 21 Azul Zulu JDK to run the tests I indeed get 4 Tests run in parallel only.
But as the waitFor method is implemented in native code, who knows that happens there and whether a macOS implementation greatly differs from other OS.
Maybe your issue - resp. the native code - is doing something like junit-team/junit5#3108 and thus suffering from the same bug that is there. Maybe the work-around I described at junit-team/junit5#3108 (comment) can also work for you if it is a similar problem. 🤷♂️
Describe the bug
I'd like concurrent testing, but only 4 tests to run at a time. If I set runner.parallel.enabled I get the former. Using .fixed does not fix the latter.
To Reproduce
My SpockConfig.groovy has,
This works when I have basic tests like this.
This does not work when my tests do,
When my tests hit that point, the test framework or the executor (not sure) admits more tests than the fixed(4) limit I tried to specify.
FWIW I'd guess what's happening is that
waitFor
is doing a yield and allowing the executor to run something else until the OS comes back with some I/O.Expected behavior
4 tests are run.
Fixed parallelism of tests should always limit the number of inflight tests.
It seems to currently be too tied to executors and not enough to the test framework actually limiting inflight tests.
Actual behavior
9 tests (all of them) are run.
Java version
Buildtool version
What operating system are you using
Mac
Dependencies
I'd prefer not to share this, let me know if you need it though.
Additional context
No response
The text was updated successfully, but these errors were encountered: