diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 8158257c9c..6c1d3bd0f9 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1095,10 +1095,12 @@ int cmCTest::RunTest(std::vector argv, { timeout = this->TimeOut; } - if (testTimeOut && testTimeOut < timeout) + if (testTimeOut + && testTimeOut < this->GetRemainingTimeAllowed()) { timeout = testTimeOut; } + // always have at least 1 second if we got to here if (timeout <= 0) {