Skip to main content
Engineering Deep Dives

Flaky Tests Are Bugs: A Field Guide

P
Priya Raman Sample

Oct 19, 2026 · 1 min read · 2 comments

A flaky test teaches your team to ignore red builds. That is far more dangerous than the bug it was meant to catch.

Common causes

  • Waiting on time instead of state (sleep(2000)).
  • Tests that share data and depend on order.
  • Animations and network calls that sometimes take longer.

Fixes that work

Wait for conditions, not durations. In Playwright, web-first assertions retry automatically:

await expect(page.getByRole('status')).toHaveText('Saved');

Give every test its own data. Quarantine flaky tests automatically and track them like any other bug.

Share WhatsApp Post LinkedIn
5 Like 8 Insightful 4 Fire
Sign in to react and save

Discussion (2)

Sign in to join the discussion.

Adaeze Okafor Sample ·

Good guide

Kenechukwu Igwe Sample ·

Web-first assertions removed about 80% of our sleeps. Great guide.