Skip to content

Commit 0f8862f

Browse files
authored
Auto enable retry when detected (#48142)
1 parent fd3007e commit 0f8862f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Cli/dotnet/Commands/Test/Terminal/TerminalTestReporter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@ public void AssemblyRunStarted(string assembly, string? targetFramework, string?
168168
var assemblyRun = GetOrAddAssemblyRun(assembly, targetFramework, architecture, executionId);
169169
assemblyRun.Tries.Add(instanceId);
170170

171+
// If we fail to parse out the parameter correctly this will enable retry on re-run of the assembly within the same execution.
172+
// Not good enough for general use, because we want to show (try 1) even on the first try, but this will at
173+
// least show (try 2) etc. So user is still aware there is retry going on, and counts of tests won't break.
174+
_isRetry |= assemblyRun.Tries.Count > 1;
175+
171176
if (_isRetry)
172177
{
173178
// When we are retrying the new assembly run should ignore all previously failed tests and

0 commit comments

Comments
 (0)