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