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.
forwardCompatibilitymutation-manifest-examplemutation-sydtest-mutation-examplemutation-sydtest-mutation-example-crosspre-commitreleaseshellconfiguredevShelldefaultmutation-sydtest-mutation-example-diffrelease-to-hackagex86_64-linux