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.
This commit is contained in:
Brad King
2018-09-12 10:49:08 -04:00
parent 344eb9c8dc
commit ed71ec7579
4 changed files with 44 additions and 18 deletions
+4 -1
View File
@@ -113,6 +113,9 @@ protected:
inline size_t GetProcessorsUsed(int index);
std::string GetName(int index);
bool CheckStopTimePassed();
void SetStopTimePassed();
void LockResources(int index);
void UnlockResources(int index);
// map from test number to set of depend tests
@@ -125,7 +128,7 @@ protected:
size_t RunningCount;
std::set<size_t> ProcessorsAvailable;
size_t HaveAffinity;
bool StopTimePassed;
bool StopTimePassed = false;
// list of test properties (indices concurrent to the test map)
PropertiesMap Properties;
std::map<int, bool> TestRunningMap;