Parallel tests don't finish when the average worker is done. The last worker sets the wait.
A test run can have eight green jobs and still keep you waiting on the ninth. When I worked on test sharding in Automated Security Helper, I wanted to know how much of that wait came from the tests themselves and how much came from the way we divided them. The two problems need different fixes.
The old assignment gave each test module a stable home by hashing its name. That made it easy to reproduce a split and to absorb new modules. But it did not know what a module cost to run. Equal numbers of files looked fair on paper. They could put two slow modules in one worker and a handful of quick ones in another.
Equal files are not equal work.
I drew the workers as lanes and the tests as blocks. If two long blocks land on the same lane, the empty space in the other lanes does not help. They cannot go back in time and pick up the work.…