SoftwareTestPilot
Automation TestingPublished: 13 min read

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.

Avinash Kamble
Founder & QA Engineer at SoftwareTestPilot
Reviewed by Priyanka G.
Share:XLinkedInWhatsApp
Flaky tests — 15 root causes and proven fixes 2026.
Flaky tests — 15 root causes and proven fixes 2026.

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)

  1. Fixed sleeps — replace with auto-waiting locators.
  2. Race on networkpage.waitForResponse then assert.
  3. Animation not settled — disable animations in test config.
  4. Focus stolen by another tab — pin browser tab, disable notifications.
  5. System clock skew — freeze time with fake timers.

2. Isolation (3 causes)

  1. Shared test data — each test creates and cleans its own user.
  2. Global state — reset localStorage / cookies between tests.
  3. Parallel worker collision — namespace by workerIndex.

3. Network and data (3 causes)

  1. Flaky third-party — stub in tests, contract-test separately.
  2. DB seeded once, mutated by tests — seed per test.
  3. External auth provider throttling — use a test tenant with high limits.

4. Infra and browser (4 causes)

  1. CPU-starved CI runner — raise runner size; do not add retries.
  2. Chrome version drift — pin browser version in Playwright config.
  3. Docker DNS caching — restart containers between suites.
  4. 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

  1. Every Monday, list top 10 tests by flake rate.
  2. Owner assigned within 24h.
  3. Quarantine tests above 20% flake — do not run on PRs.
  4. 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?
Under 2% is healthy, 2-5% needs attention, above 5% is a crisis.
2.Should I add retries to hide flake?
Never as a first response. Retries mask root causes and inflate CI cost.
3.Does AI self-healing fix flake?
It fixes locator drift, one of the 15 causes. It does not fix timing or isolation flake.
4.How do I measure flake rate?
(Retries on same commit) / (Total runs). Most CI dashboards expose this. If not, log per-run outcomes to your data warehouse.
Keep going

Practice these questions

Rehearse Selenium and Playwright automation questions covering framework design, waits, locators and CI/CD.

Found this useful?
Share:XLinkedInWhatsApp

Was this article helpful?

Cluster · AI in Testing

More from Self-Healing Tests

AI locator strategies to fight test flakiness.

Pillar guide · 4 articles
More in this cluster
From the AI in Testing pillar

Keep building your QA edge

Continue reading

Topic mapConcepts · Tools · People · Standards

Related 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.

Core testing concepts
Test PyramidShift-Left TestingBehavior-Driven DevelopmentTest-Driven DevelopmentPage Object ModelContract TestingExploratory TestingRisk-Based TestingEquivalence PartitioningBoundary Value Analysis
Programming languages
JavaPythonJavaScriptTypeScriptC#SQL
Certifications worth knowing
ISTQB Foundation LevelISTQB Advanced — Test AnalystISTQB Agile TesterCertified Selenium ProfessionalAWS Certified DevOps EngineerCertified ScrumMaster (CSM)
Companies hiring for this skill
GoogleMicrosoftAmazonMetaNetflixAtlassianThoughtWorksInfosysTCSWipro

Discussion

Ask a question, share your experience, or correct us. Be kind — real people are reading.

Join the QA Community

Connect with fellow testers, share job leads, and get career advice.

Premium QA Resources

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
4.9/5 rating
Explore All Products

⭐⭐⭐⭐⭐ Trusted by 1,000+ Software Test Pilots • Instant Access