Flaky CI is blocking merges on the monorepo
One-page pitch · Tue Oct 27 · 6 people · 2 minutes
A pitch from the room. Nobody has approved building it yet.
- Time budget
- 2 weeks
Solution
✦Three of six leaned towards fixing the checkout e2e suite first, since it is half the flakes.
- Quarantine flaky tests without blocking merges✦Backed by 6 of 6 · 1 concern, 1 unsureOwner: Marco · due Tue Oct 27Done when: shipped and used for real (D1)
- Quarantine lane: known flaky tests run but do not block merge
- Retry only the failed test once, not the whole pipeline
- Quarantined tests expire after 14 days and block again
- Fix the checkout e2e suite first, it is half our flakesBacked by 3 of 6, decided narrowlyOwner: Jen · due Fri Oct 30Done when: shipped and used for real (D2)
Notes from the discussion
- Platform can give us a second runner pool this sprint
2 weeks, set when the room started. If it doesn’t fit, cut scope rather than extend the time.
Why
✦Last month 41% of merge attempts needed at least one rerun.
- Reruns waste time and CI money✦
- CI takes 38 minutes, so one flake costs an hour
- We rerun the whole pipeline 3 or 4 times before a merge goes through
- Reruns cost us about $3k a month in CI minutes
- You cannot tell a real failure from a flake without rerunning
- Flaky tests have no owner or fix✦
- Flaky tests get skipped in a PR and never turned back on
- Nobody knows who owns a flaky test once it starts failing
- The checkout e2e suite fails about 1 run in 6 for no reason
Notes from the discussion
- Last month 41% of merge attempts needed at least one rerun
Not doing
✦Four of six said no to test impact analysis so only affected tests run.
- Moving off GitHub Actions to Buildkiteout of scope
- Test impact analysis so we only run affected testsout of scope
- Split pipeline so fast tests gate merge✦2 of 6 voted for it
- No admin-override merges except during incidents1 of 6 voted for it
- Assign owners so every flake gets fixed✦nobody voted for it
- Give each integration test run its own database schemanobody voted for it; one person can vote for more than one option
Action items
C1, A1, Q1 and the like are short IDs your coding agent uses to point at one line.
- S1 The decision: Quarantine flaky tests without blocking merges✦Done when: shipped and used for real (D1)Marco Tue Oct 27
- S2 The decision: Fix the checkout e2e suite first, it is half our flakesDone when: shipped and used for real (D2)Jen Fri Oct 30
- H1 Handle: Making every single test hermeticDone when: contained before launch, not done (D4)Sam Next sprint
- H2 Handle: Getting the legacy billing tests to 100% greenDone when: contained before launch, not done (D5)Ade Tue Oct 27
- Q1 Decide: Who decides when a quarantined test gets fixed or deleted?✦Lin Fri Oct 30
- A1 Ask Platform to confirm the second runner pool for this sprint✦Marco
- A2 Find the checkout e2e tests that cause the most flaky reruns✦Left unassigned
Each gets a patch now, not a project of its own.
Left unassigned: A2. It stays in the summary with no owner.
First step today: Marco, S1.
Done when
We’ll know it worked when
- “Reruns waste time and CI money” is no longer true✦
Notes from the discussion
- Measure it on the two weeks after the merge queue ships
Done when, drafted by Claude
- Merge queue has run for two weeks and the rerun rate is measured✦
- Reruns per merge attempt are reported against the 41% baseline✦
Open questions
- Who decides when a quarantined test gets fixed or deleted?✦the question nobody asked: Lin will decide, by Fri Oct 30
- Platform owns the runners; nobody owns the test code yet
Appendix · How the room voted · Risks · Also raised
How the room voted
- Reruns waste time and CI money✦Problem · 6 of 6 · clear
- Flaky tests have no owner or fix✦Problem · 3 of 6 · leaning
- Quarantine flaky tests without blocking merges✦Solution · 6 of 6 · clear
- Fix the checkout e2e suite first, it is half our flakesSolution · 3 of 6 · leaning
- “Quarantine flaky tests without blocking merges” is shipped and used for real✦Done when · 5 of 6 · clear
- “Fix the checkout e2e suite first, it is half our flakes” is shipped and used for realDone when · 5 of 6 · clear
- “Reruns waste time and CI money” is no longer true✦Done when · 4 of 6 · leaning
- “Making every single test hermetic” is contained before launch, not doneDone when · 4 of 6 · leaning
- “Getting the legacy billing tests to 100% green” is contained before launch, not doneDone when · 5 of 6 · clear
Clear: three quarters or more voted for it. Leaning: at least half. Minority: under half.
Risks
Not a risk
- Building our own flake detection instead of using the CI vendor’s
- Rewriting the whole e2e suite in Playwright
Also raised
- New hires think they broke something when CI flakesProblem: not saved
- Integration tests share one staging database and collideProblem: not saved
- Main branch is often red✦Problem: not saved





