Skip to content

Retry failed tests up to 3 times in CI, like upstream - #90

Open
kblok wants to merge 1 commit into
mainfrom
ci/retry-failed-tests
Open

kblok wants to merge 1 commit into
mainfrom
ci/retry-failed-tests

Conversation

@kblok

@kblok kblok commented Oct 6, 2026

Copy link
Copy Markdown
Member

Upstream Playwright retries failed library tests up to 3 times on CI (retries: process.env.CI ? 3 : 0), and that is how it stays green with known browser races. One example is the Chromium WebMCP iframe hang: a child frame's getTools() sometimes never resolves, even from plain page JavaScript. CI now does the same. After the normal run, a small script re-runs only the failed tests in a fresh test process, up to 3 more times. A test that passes on a retry is listed as flaky in the log and the job summary, and does not fail the job.

The retry happens at the workflow level, not inside NUnit. NUnit allows only one repeat attribute per test, many tests carry two [PlaywrightTest] attributes, and [Retry] does not cover errors or timeouts. A fresh process also gives each retry a clean SetUp and TearDown, and handles timed-out tests whose TearDown would otherwise run late. Local dotnet test runs are unchanged.

🤖 Generated with Claude Code

Upstream runs library tests with retries: process.env.CI ? 3 : 0. Do the
same in CI: after the run, re-run only the failed tests, in a fresh test
process, up to 3 more times. A test that passes on a retry is listed as
flaky and does not fail the job. Local runs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant