Debug flaky tests: race conditions and timing

11 steps · about 3 h 35 min · Intermediate

  1. Async race conditions and flaky tests (article, BuildPulse, 15 min)

    It shows how to reproduce a race on purpose with loops and added latency, which you need before you can fix it.

  2. How to Fix 'Race Condition' Test Failures (article, OneUptime, 15 min)

    It gives concrete bad-versus-good patterns across several languages, including sleep-based assertions and shared state.

  3. Root Cause 1: Timing, Sleeps and Waits (article, TestingBot, 15 min)

    It focuses on timing, including the trap of starting a network wait after the click.

  4. Playwright Waits and Timeouts: How Auto-Waiting Works (article, Hyperping, 15 min)

    It explains how auto-waiting and retrying assertions replace sleeps, which is the standard fix for UI timing flakes.

  5. Why Your E2E Tests Are Flaky (And How to Fix Them) (article, Webstack Builders, 15 min)

    It works through form-submission and navigation races, so you learn to wait for the event that causes the state change.

  6. Playwright: Diagnosing and Fixing Flaky Tests (article, Montelli, 20 min)

    It adds repeat-each runs and Trace Viewer on first retry, so you can capture evidence of a failure that only shows up in CI.

  7. How to Debug Flaky E2E Tests: A Practical Workflow (article, CueTest, 10 min)

    It pulls reproduce, categorise, inspect, fix and prove into one repeatable workflow.

  8. Catching Race Conditions in Go (article, DEV Community (frosnerd), 15 min)

    It moves from timing guesses to tooling: a race detector reports unsynchronised memory access directly.

  9. ThreadSanitizerCppManual (reference, Google sanitizers wiki, 25 min)

    It is the original manual for the data race detector behind Go's -race flag, and covers C and C++.

  10. 16.2 Race Detection (article, Go under the hood (golang.design), 25 min)

    It explains happens-before and why race reports are reliable, so you can read a detector report with confidence.

  11. ThreadSanitizer: data race detection in practice (doc, Google Research, 45 min)

    It is the original paper behind the tool, for readers who want to understand how detection works.