Proper log monitoring shutdown
This commit is contained in:
parent
b23c66c86e
commit
da855b8d0d
|
@ -73,6 +73,7 @@ namespace ContinuousTests
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -73,12 +73,10 @@ namespace ContinuousTests
|
|||
try
|
||||
{
|
||||
foreach (var m in monitors) m.Run();
|
||||
fixtureLog.Log("Monitor start");
|
||||
|
||||
RunTestMoments();
|
||||
|
||||
foreach (var m in monitors) m.Stop();
|
||||
if (monitors.Any(m => m.Fault)) throw new Exception("Any faulted");
|
||||
|
||||
if (!config.KeepPassedTestLogs)
|
||||
{
|
||||
fixtureLog.Delete();
|
||||
|
@ -103,6 +101,13 @@ namespace ContinuousTests
|
|||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
fixtureLog.Log("Monitor stop");
|
||||
foreach (var m in monitors) m.Stop();
|
||||
if (monitors.Any(m => m.Fault)) throw new Exception("One or more downloaded container log is missing lines!");
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyLogReplacements(FixtureLog fixtureLog, StartupChecker startupChecker)
|
||||
|
@ -143,6 +148,7 @@ namespace ContinuousTests
|
|||
return;
|
||||
}
|
||||
}
|
||||
fixtureLog.Log("Test run has been cancelled.");
|
||||
}
|
||||
|
||||
private void ThrowFailTest()
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace ContinuousTests
|
|||
{
|
||||
NumberOfPasses = 0;
|
||||
NumberOfFailures = 0;
|
||||
while (true)
|
||||
while (!cancelToken.IsCancellationRequested)
|
||||
{
|
||||
WaitHandle.WaitAny(new[] { runFinishedHandle, cancelToken.WaitHandle });
|
||||
|
||||
|
|
Loading…
Reference in New Issue