Flaky Tests — 15 Causes and Proven Fixes (2026)
The 15 root causes of flaky tests in 2026 and the exact fix for each. Timing, isolation, data, network, browser, CI, and infra causes — with Playwright, Cypress, and Selenium code samples.

Last updated 2026-07-20 · 13 min read · By Avinash Kamble, reviewed by Priyanka G.
Flake rate is the single strongest predictor of whether a QA team ships on time. Above 5% flake, engineers stop trusting CI; above 10%, they stop reading it. Here are the 15 causes we see repeatedly across audits — and the proven fix for each.
Key takeaways
- The 15 root causes grouped by category.
- Playwright, Cypress, and Selenium fixes for each.
- A weekly triage ritual that keeps flake below 2%.
- The one metric to track (Flake Rate, not Pass Rate).
1. Timing (5 causes)
- Fixed sleeps — replace with auto-waiting locators.
- Race on network —
page.waitForResponsethen assert. - Animation not settled — disable animations in test config.
- Focus stolen by another tab — pin browser tab, disable notifications.
- System clock skew — freeze time with fake timers.
2. Isolation (3 causes)
- Shared test data — each test creates and cleans its own user.
- Global state — reset localStorage / cookies between tests.
- Parallel worker collision — namespace by workerIndex.
3. Network and data (3 causes)
- Flaky third-party — stub in tests, contract-test separately.
- DB seeded once, mutated by tests — seed per test.
- External auth provider throttling — use a test tenant with high limits.
4. Infra and browser (4 causes)
- CPU-starved CI runner — raise runner size; do not add retries.
- Chrome version drift — pin browser version in Playwright config.
- Docker DNS caching — restart containers between suites.
- Retry masking real bugs — cap retries at 1 and quarantine on second failure.
5. Playwright fix sample — replace sleeps
// Bad
await page.waitForTimeout(3000);
await page.click('#submit');
// Good
await page.getByRole('button', { name: 'Submit' }).click();
await expect(page.getByRole('alert')).toBeVisible();See the Playwright masterclass and Selenium interview questions for framework-specific patterns.
6. Weekly triage ritual
- Every Monday, list top 10 tests by flake rate.
- Owner assigned within 24h.
- Quarantine tests above 20% flake — do not run on PRs.
- Hard cap: quarantine expires after 5 days; test is fixed or deleted.
Reference: Google Testing Blog on flakiness.
Frequently asked questions
1.What flake rate is acceptable in 2026?
2.Should I add retries to hide flake?
3.Does AI self-healing fix flake?
4.How do I measure flake rate?
Practice these questions
Rehearse Selenium and Playwright automation questions covering framework design, waits, locators and CI/CD.
Was this article helpful?
More from Self-Healing Tests
AI locator strategies to fight test flakiness.
- AI in TestingSelf-Healing Selenium Tests with AI: 2026 Guide
- AI in TestingGenerative AI Regression Testing in 2026: Smart Test Selection, Auto-Healing & Full Playbook
- AI in TestingAI Flaky Test Detection in 2026: Cluster, Triage & Fix (Playbook + FAQ)
Keep building your QA edge
Pillar guides- Automation QA Engineer RoleAutomation QA Engineer career guideAutomation QA Engineer job scope, tools, salary, and hiring pipeline.
- SDET Rolebecome an SDET in 2026What SDETs actually do — skills, salary bands, and interview prep for 2026.
- QA Jobs Radarsee today's openingsLive QA / SDET / automation job feed, refreshed daily.
Continue reading

Playwright Locator Best Practices (2026) — The Only Guide You Need
11 min read
How to Migrate a Postman Collection to Playwright API Tests (2026 Guide)
12 min read
Why Every QA Engineer Must Master CI/CD Pipelines in 2026 (Or Risk Obsolescence)
12 min readRelated concepts, tools & standards around Automation Testing
A quick reference of the people, companies, frameworks and technologies most often mentioned alongside Automation Testing in real QA teams — useful when you're mapping a learning path, preparing for interviews, or scoping a new project.
Join the QA Community
Connect with fellow testers, share job leads, and get career advice.
Stop Reinventing the Wheel. Upgrade Your QA Arsenal.
Take your testing skills from beginner to Lead Engineer. Supercharge your daily workflow with our premium digital resources.
- Ready-to-use testing strategy templates
- Advanced API & UI automation guides
- ⏱️ Save 10+ hours a week on test planning
Discussion
Ask a question, share your experience, or correct us. Be kind — real people are reading.