84c954df

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 runs on, so a single processor, or a single core from nix, is
warned about 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 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

Total

5m08s

Created Started Finished

Time to Start Worker time Duration Time to finish Idle
Config 1m00s 0s 0s 1m01s 1m00s
Eval 3m38s 2m30s 2m30s 6m09s 3m52s
Build - - - - -
Suite 1m00s 2m31s 5m08s 6m09s 4m53s

Timeline

Config Eval Failed Retried Compressed gap
0s3m40s4m4m20s4m40s5m5m20s5m40s6m