Skip to content

Flaky tests.
Named, fixed, quarantined.

Flaky tests are not random noise. They follow patterns, and the patterns are specific to each test framework. Once you name the pattern, you can kill it. This guide covers every major framework, with the fixes we have seen work across thousands of CI pipelines.

By Julien Danjou, Co-founder & CEO of Mergify Updated

Pick your framework

Every framework has its own flakiness patterns. Start with yours.

Jest

Fake timers, snapshot drift, and the async traps behind flaky Jest suites.

Read the guide →
pytest

Fixture teardown races, xdist ordering, and Hypothesis seed non-determinism.

Read the guide →
Cypress

cy.wait() races, network stubbing, and retry-ability gotchas.

Read the guide →
Playwright

Auto-waiting versus explicit waits, trace-level debugging, and retry config.

Read the guide →
Vitest

Thread vs fork pool, mock hoisting, and shared-state snapshot flakiness.

Read the guide →
RSpec

Order-dependent specs, database_cleaner strategies, and rspec-retry pitfalls.

Read the guide →
Minitest

Parallelization races, fixture loading, and test isolation in Rails suites.

Read the guide →
Go

t.Parallel() races, goroutine leaks, and nondeterministic map iteration.

Read the guide →
Rust

Test-thread races, async runtime drift, and cargo test parallelism.

Read the guide →
JUnit

Method ordering, Surefire forking, and shared static state in Spring tests.

Read the guide →
TestNG

Dependency groups, parallel methods, and retry analyzers done wrong.

Read the guide →
PHPUnit

Test isolation, database transactions, and dataProvider non-determinism.

Read the guide →
Pest

Higher-order tests, parallel execution, and the Laravel testing stack.

Read the guide →
NUnit

ParallelizableAttribute, TestContext races, and fixture reuse pitfalls.

Read the guide →
MSTest

Assembly initialization, DeploymentItem races, and parallel test settings.

Read the guide →

Kill flaky tests across every framework in your stack.

2k+ organizations use Mergify to merge 75k+ pull requests a month without breaking main.