Distribute parallel executed test according to execution time, not order

Using Gradle 2.0 I tried making better use of my resources by executing tests in parallel, using the forkEvery and maxParallelForks properties within task ‘test’ which worked nicely, with one exception. I have a few tests which run slightly longer than others. While this shouldn’t be a problem, as I run tests in parallel, it still is a problem, because it looks like there is as many queues as maxParallelForks.

Having 16 tests, of which 1 needs as long, as all the others combined, using 4 parallel forks with fork on every class, (assuming the long running is one of the first to execute), 13 tests (executors) would be finished around the same time … and the remaining 3 would run in serie afterwards.

Now add some bad luck and you have lots of long running ones queued after each other, instead of parallel.

Don’t get me wrong, I’m very happy with the forking, as it does decrease feedback time, but I just wonder if there is some flag, or feature I can make use of to distribute my tests evenly over time.