Skip to content

Misleading CTest WAITING message

We have a project that has a large number of tests. Some of them are marked with RUN_SERIAL.

Some of the normal tests take some time, leading to ctest printing out the ***** WAITING message.

However, when only the RUN_SERIAL tests are left, and it's still executing one of the "normal" tests, it will print out System Load: 1, Max Allowed Load: 9, Smallest test requires 8, if it's executed with -l 9 -j 8 for instance.

Now this is of course not quite correct. It's unable to launch any new tests because the remaining ones are RUN_SERIAL, not because the load is too high.

Looking at cmCTestMultiProcessHandler::StartNextTests(), when it does the check in if (allTestsFailedTestLoadCheck), the logic appears to need a further case, like so:

    bool OnlyRunSerialTestsLeft = ...;
    if (this->SerialTestRunning) {
      cmCTestLog(this->CTest, HANDLER_OUTPUT,
                 "Waiting for RUN_SERIAL test to finish.");
    } else if (OnlyRunSerialTestsLeft)  {
      cmCTestLog(this->CTest, HANDLER_OUTPUT,
                 "Waiting for tests to complete, so RUN_SERIAL test can start.");
    } else {
      /* clang-format off */
      cmCTestLog(this->CTest, HANDLER_OUTPUT,
                 "System Load: " << systemLoad << ", "
                 ...)

I'm not entirely sure how to determine this case, I guess it requires looping over all of the tests.

It makes the load balancing look broken when in fact it's working entirely as expected.

Thanks

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information