0f271b9f

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

Let a test group bound how many of it run at once

Parallelism was Parallel or Sequential, so a group whose tests contend
for something the suite does not own had one instrument available: stop
them all from overlapping.

That is more than such a group usually needs. Tests sharing one database
server, with a database each, slow each other down past some number of
them at once, not past one. In nix-ci's cache garbage collector spec,
which is where this came up, the difference is worth measuring: that
spec takes 20s with one test at a time and 6s with four, against 3s
unbounded. Sequential buys the quiet at three times the wall clock of a
bound that would have been just as quiet.

So add a bound. ParallelWith n still queues its tests like any other,
and holds them at a semaphore of n on the way in, so it only ever runs
fewer of them than the threads would allow, never more.

The semaphore is made when the runner enters the node, so everything
below one ParallelWith shares one bound rather than each group below it
getting its own. The runner's environment carries it already resolved,
which is why it holds a RunParallelism rather than the Parallelism the
spec tree is written in: a bound with no semaphore should not be a state
this can be in.

Parallelism is exported with all its constructors, so an exhaustive
match on it now needs a third case. That is a major version under the
PVP, however much this reads like an addition. Nothing in the repo
bounds sydtest from above, so no dependent needs moving.

Total

47m05s

Created Started Finished

Time to Start Worker time Duration Time to finish Idle
Config 1s 0s 0s 2s 1s
Eval 38s 45s 45s 1m24s 35s
Build 1m22s 0s 45m27s 46m50s 45m25s
Deploy 46m50s 17s 17s 47m07s 0s
Suite 1s 1m04s 47m05s 47m07s 46m03s

Timeline

Config Eval Build Deploy Compressed gap
0s40s50s1m1m10s1m20s47m