Skip to content

Commit

Permalink
Emit a warning when automation tests are cancelled due to the overall…
Browse files Browse the repository at this point in the history
… test run timeout
  • Loading branch information
hach-que committed Jun 30, 2023
1 parent 64601e6 commit 9d3442f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions UET/Redpoint.Uet.Automation/Runner/DefaultAutomationRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ private async Task TimeoutAsync()
if (_configuration.TestRunTimeout.HasValue && _configuration.TestRunTimeout.Value != TimeSpan.MaxValue)
{
await Task.Delay((int)_configuration.TestRunTimeout.Value.TotalMilliseconds, _cancellationTokenSource.Token);
_logger.LogWarning($"Test run exceeded timeout of {_configuration.TestRunTimeout.Value.TotalMinutes:0.##} minutes, so the test run is being cancelled. If you're using a BuildConfig.json file, you can increase the overall timeout by setting the 'TestRunTimeoutMinutes' property.");
_cancellationTokenSource.Cancel();
}
}
Expand Down Expand Up @@ -467,6 +468,7 @@ await workerState.TransportConnection.ReceiveUntilAsync(async message =>
// The test run is being cancelled or timed out.
nextTest.DateFinished = DateTimeOffset.UtcNow;
nextTest.TestStatus = TestResultStatus.Cancelled;
nextTest.Duration = nextTest.DateFinished - nextTest.DateStarted;
workerGroupState.RemainingTests--;
workerGroupState.ProcessedTests.Add(nextTest);
await _testLogger.LogFinished(worker, GetProgressionInfo(), nextTest);
Expand All @@ -482,6 +484,7 @@ await workerState.TransportConnection.ReceiveUntilAsync(async message =>
nextTest.AutomationRunnerCrashInfo = ex;
nextTest.DateFinished = DateTimeOffset.UtcNow;
nextTest.TestStatus = TestResultStatus.Crashed;
nextTest.Duration = nextTest.DateFinished - nextTest.DateStarted;
workerGroupState.RemainingTests--;
workerGroupState.ProcessedTests.Add(nextTest);
await _testLogger.LogFinished(worker, GetProgressionInfo(), nextTest);
Expand Down

0 comments on commit 9d3442f

Please sign in to comment.