9b8e8d28

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

Warn about one capability whenever tests would run at the same time

The warning to compile a test suite with -threaded -rtsopts
-with-rtsopts=-N fired whenever the thread count was left to the
capabilities and there was one of them. That missed the cases where the
thread count was asked for: a suite run with --jobs 4 on one capability
runs its tests one at a time just the same, and never exercises the
thread safety that tests running at the same time are there to find, so
it said nothing while the advice applied.

So ask both of the questions the advice depends on, in
oneCapabilityWarning. Is the RTS down to a single capability, which is
what -N raises? And would the suite use more than one if it had them,
which is all the advice buys? Synchronous would not, and neither would
an Asynchronous bound of a single test, so those stay quiet. The advice
is about how the suite is compiled rather than about the machine it is
on, so a single-processor machine is warned too: a suite built without
-N has one capability everywhere, and staying quiet would hide that on
exactly the small CI runners where a suite is first run.

The capability count is newtyped so that a call site says which count
it is passing.

The message now names capabilities rather than CPU cores. That is what
it has always counted, and the two only looked alike while it fired for
the capability count alone: a suite told to use four threads on a
64-core machine, without -N, has one capability and 64 cores.
GitHub
Time to Start Worker time Duration Time to finish Idle
Config 13m34s 1s 1s 13m36s 13m34s
Eval - - - - 1m08s
Build - - - - -
Suite 13m34s 1s - - 14m43s