Christian Beikov
09/12/2025, 3:26 PMorg.gradle.test.worker system property?Christian Beikov
09/12/2025, 3:30 PMworker % NChristian Beikov
09/12/2025, 3:31 PMChristian Beikov
09/12/2025, 3:31 PMChristian Beikov
09/12/2025, 3:32 PMBenedikt Ritter
09/12/2025, 5:22 PMVampire
09/13/2025, 11:41 AMChristian Beikov
09/15/2025, 7:29 AMVampire
09/15/2025, 8:30 AMChristian Beikov
09/15/2025, 11:35 AMChristian Beikov
09/15/2025, 11:36 AMX ... X+N where N is test.maxParallelForks ?Christian Beikov
09/15/2025, 11:37 AMVampire
09/15/2025, 11:56 AMVampire
09/15/2025, 11:57 AMVampire
09/15/2025, 11:57 AMChristian Beikov
09/15/2025, 11:58 AMChristian Beikov
09/15/2025, 11:58 AMVampire
09/15/2025, 11:59 AMChristian Beikov
09/15/2025, 12:00 PMChristian Beikov
09/15/2025, 12:00 PMChristian Beikov
09/15/2025, 12:00 PMChristian Beikov
09/15/2025, 12:01 PMChristian Beikov
09/15/2025, 12:02 PMVampire
09/15/2025, 12:06 PMorg.gradle.test.worker.
I just tried with
maxParallelForks = 1
forkEvery = 1
and output the value and it was 13 and 14 on first run and 15 and 16 on rerun.
So the test workers are also per daemon lifetime, not per build execution.
And at least with parallel task execution there can for sure also be gaps I'd say now.Christian Beikov
09/15/2025, 12:06 PMVampire
09/15/2025, 12:07 PMVampire
09/15/2025, 12:07 PMVampire
09/15/2025, 12:07 PMChristian Beikov
09/15/2025, 12:09 PMChristian Beikov
09/15/2025, 12:11 PMMaxNParallelTestClassProcessor and ForkingTestClassProcessor , it seems that since WorkerProcessFactory#idGenerator is shared, there can indeed be gapsChristian Beikov
09/15/2025, 12:12 PMChristian Beikov
09/15/2025, 12:22 PMTimeZone for the scope of a test and dealing with that when using JUnit Jupiter parallelization is a bit painful, hence my preference to stick to JVM forkingVampire
09/15/2025, 1:02 PMVampire
09/15/2025, 1:03 PMVampire
09/15/2025, 1:04 PMChristian Beikov
09/15/2025, 1:08 PM@Isolated annotation which can be put on such global state mutating tests to make them run in isolation. I'll try that then.Christian Beikov
09/15/2025, 1:08 PMFor example if you have 50 tests and 5 max parallel forks, Gradle cannot know how to best split it so that you leverage resources best. It will just give the 10 tests to each fork.That's a good point, I realized this already, but it was mostly good enough for my use cases
Vampire
09/15/2025, 1:18 PM@Isolated you can use of course, but you disable parallelity for those of course.
If you use an explicit resource lock on all tests that depend on such global state, then only those are not run in parallel, and even more if you can split by read-lock and read-write-lock.