Fixes incorrect log message when test run gets cancelled.
This commit is contained in:
parent
da855b8d0d
commit
73c49b42c6
|
@ -59,9 +59,9 @@ namespace ContinuousTests
|
|||
|
||||
overviewLog.Log("Finished launching test-loops.");
|
||||
WaitUntilFinished(overviewLog, statusLog, startTime, testLoops);
|
||||
overviewLog.Log("Cancelling all test-loops...");
|
||||
overviewLog.Log("Stopping all test-loops...");
|
||||
taskFactory.WaitAll();
|
||||
overviewLog.Log("All tasks cancelled.");
|
||||
overviewLog.Log("All tasks finished.");
|
||||
}
|
||||
|
||||
private void WaitUntilFinished(LogSplitter overviewLog, StatusLog statusLog, DateTime startTime, TestLoop[] testLoops)
|
||||
|
@ -72,16 +72,20 @@ namespace ContinuousTests
|
|||
if (config.TargetDurationSeconds > 0)
|
||||
{
|
||||
var targetDuration = TimeSpan.FromSeconds(config.TargetDurationSeconds);
|
||||
cancelToken.WaitHandle.WaitOne(targetDuration);
|
||||
Cancellation.Cts.Cancel();
|
||||
overviewLog.Log($"Congratulations! The targer duration has been reached! ({Time.FormatDuration(targetDuration)})");
|
||||
statusLog.ConcludeTest("Passed", testDuration, testData);
|
||||
var wasCancelled = cancelToken.WaitHandle.WaitOne(targetDuration);
|
||||
if (!wasCancelled)
|
||||
{
|
||||
Cancellation.Cts.Cancel();
|
||||
overviewLog.Log($"Congratulations! The targer duration has been reached! ({Time.FormatDuration(targetDuration)})");
|
||||
statusLog.ConcludeTest("Passed", testDuration, testData);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cancelToken.WaitHandle.WaitOne();
|
||||
statusLog.ConcludeTest("Failed", testDuration, testData);
|
||||
}
|
||||
statusLog.ConcludeTest("Failed", testDuration, testData);
|
||||
}
|
||||
|
||||
private Dictionary<string, string> FormatTestRuns(TestLoop[] testLoops)
|
||||
|
|
Loading…
Reference in New Issue