How does Gradle's java plugin run JUnit tests in parallel: one queue per fork or a single queue and multiple forks? How does Gradle's java plugin run JUnit tests in parallel: one queue per fork or a single queue and multiple forks? selenium selenium

How does Gradle's java plugin run JUnit tests in parallel: one queue per fork or a single queue and multiple forks?


it's the latter. gradle uses one queue and distributes each entry clockwise to the running processes. Say you have 4 tests:

  • Test1 taking 10s
  • Test2 taking 1s
  • Test3 taking 10s
  • Test4 taking 1s

and using maxParallelForks = 2 the overall test task execution would be around 20s. I guess we need to discuss if this can be improved by getting notified about "free" processes to assign Test3 directly to test worker process 2 after Test2 comes back after 1s.


As of July 2021, Your question (and my experience) matches the issue described in this issue which"has been automatically closed due to inactivity".

The issue is not resolved, and yes, the system assigns tasks early and does not rebalance to use idle workers.