Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry logic to stabilize flaky UI tests #3180

Merged
merged 5 commits into from
Jan 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/E2E Tests/WebAppUiTests/UiTestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public static Process StartProcessLocally(
Process? process;
do
{
Thread.Sleep(1000 * currentAttempt++); // Exponential backoff
kllysng marked this conversation as resolved.
Show resolved Hide resolved
process = Process.Start(processStartInfo);
} while (currentAttempt++ <= maxRetries && ProcessIsAlive(process));
kllysng marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -179,6 +180,13 @@ public static Process StartProcessLocally(
}
else
{
// Log the output and error streams
process.OutputDataReceived += (sender, e) => Console.WriteLine(e.Data);
process.ErrorDataReceived += (sender, e) => Console.Error.WriteLine(e.Data);

process.BeginOutputReadLine();
process.BeginErrorReadLine();
kllysng marked this conversation as resolved.
Show resolved Hide resolved

return process;
}
}
Expand Down
Loading