Retry E2E tests once in CI and report flaky results - #8318
Draft
isaacroldan wants to merge 1 commit into
Draft
Conversation
With retries: 0, a single flaky interaction fails the whole shard. CI now retries each failing test once; a test that passes on retry keeps the shard green. Retries are only honest if flake stays visible, so the JSON reporter is enabled in CI and scripts/report-flaky.js surfaces every failed-then-passed test as a grep-able FLAKY: log line and in the GitHub job summary. maxFailures goes from 3 to 5 because first attempts of flaky tests count toward it, and the old limit could stop a shard before retries prove tests flaky rather than broken. Local runs keep retries: 0 so flake fails fast during development. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
The E2E suite runs with
retries: 0, so one flaky interaction fails the entire shard. Retrying alone would just hide the flake, so this pairs the retry with reporting.WHAT is this pull request doing?
retries: isCI ? 1 : 0— a test that fails once and passes on retry keeps the shard green. Local runs keep zero retries so flake fails fast during development.maxFailures: 3 → 5in CI — first attempts of flaky tests count toward the early-stop limit, so the old value could kill a shard before retries got to prove tests flaky rather than broken.scripts/report-flaky.js— every failed-then-passed test is printed as a grep-ableFLAKY:log line and listed in the GitHub job summary, so the nightly failure counter (and humans) can track flake instead of losing it to green shards.Interaction with the cli-kit throttle retry (#8317)
Layered deliberately: the CLI-level retry absorbs short throttle bursts inside a command; the Playwright retry covers everything else. Worst-case per-test wall clock grows — if shards start brushing the 20-minute job timeout, that's the knob to revisit.
How to test your changes?
Measuring impact
🤖 Generated with Claude Code