How to Handle a Flaky Required Check Blocking the Merge Queue
A flaky required check fails intermittently on the merge group, so the queue drops the pull request and rebuilds the batch, stalling throughput.
Because the queue removes any PR whose required check fails, a flaky check can churn the whole queue. Add bounded retries, quarantine known-flaky tests, and keep the flaky suite non-required until stabilized.
Steps
- Add bounded retries to the flaky command so transient failures self-heal.
- Quarantine known-flaky tests out of the required suite.
- Track flake rate and only re-add the check once it is stable.
Retry the flaky step
.github/workflows/ci.yml
steps:
- uses: nick-fields/retry@v3
with:
max_attempts: 3
timeout_minutes: 15
command: npm run test:e2eQuarantine at the test level
Terminal
# Skip a known-flaky test until it is fixed (Jest)
test.skip('reconnects after network blip', () => {})Gotchas
- Blanket retries hide real regressions; scope them to genuinely transient steps.
- A flaky required check on the merge group rebuilds the whole batch, multiplying wasted minutes; Latchkey managed runners auto-retry transient infrastructure failures to cut that churn.
Related guides
How to Fix a Merge Queue Stuck on an Expected CheckResolve a merge queue entry that sits pending forever because a required check is listed as expected but neve…
How to Keep the Merge Queue FastReduce merge queue latency with dependency caching, test impact analysis, and right-sized batching so pull re…
How to Configure Required Status Checks With the Merge QueueSelect which status checks the GitHub merge queue must pass, and make sure every required check runs on the m…