diff options
author | Brad King <brad.king@kitware.com> | 2018-09-12 14:49:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-09-12 14:59:55 (GMT) |
commit | ed71ec757995e78de31a083a6c8b1092b13dbc08 (patch) | |
tree | 3eb1a18db69b44f4dfaf46bc6baf89d74552d1c8 /Source/CTest/cmCTestRunTest.cxx | |
parent | 344eb9c8dc3b16a524729cb66ad25fc1c127a02c (diff) | |
download | CMake-ed71ec757995e78de31a083a6c8b1092b13dbc08.zip CMake-ed71ec757995e78de31a083a6c8b1092b13dbc08.tar.gz CMake-ed71ec757995e78de31a083a6c8b1092b13dbc08.tar.bz2 |
CTest: Improve stop-time implementation
The CTestTestStopTime test has been failing sporadically because the
stop time causes the first internal test to have a timeout short enough
that we might hit it and start the second test just before the stop time
is reached. Instead we should track when a timeout is shortened in
order to stay within the stop time. If a test times out for this reason
then we should consider the stop time reached and not start any more
tests.
Diffstat (limited to 'Source/CTest/cmCTestRunTest.cxx')
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index ef0a49d..23d4616 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -140,6 +140,9 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) bool passed = true; cmProcess::State res = started ? this->TestProcess->GetProcessStatus() : cmProcess::State::Error; + if (res != cmProcess::State::Expired) { + this->TimeoutIsForStopTime = false; + } int retVal = this->TestProcess->GetExitValue(); bool forceFail = false; bool skipped = false; @@ -537,6 +540,7 @@ bool cmCTestRunTest::StartTest(size_t total) auto timeout = this->TestProperties->Timeout; + this->TimeoutIsForStopTime = false; std::chrono::system_clock::time_point stop_time = this->CTest->GetStopTime(); if (stop_time != std::chrono::system_clock::time_point()) { std::chrono::duration<double> stop_timeout = @@ -547,6 +551,7 @@ bool cmCTestRunTest::StartTest(size_t total) } if (timeout == std::chrono::duration<double>::zero() || stop_timeout < timeout) { + this->TimeoutIsForStopTime = true; timeout = stop_timeout; } } |