e17b64ba

Created Started Cancelled

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 warning reads the thread count that is run with rather than the one
that was configured, which is the same binding that reaches the
settings. That keeps a build nix narrowed down to one core quiet, since
one core resolves to a synchronous run either way.

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