OhMyBug

tests/ci

Test Relies On Real Timing

#38rare33 sightingsfirst seen August 2026

What goes wrong

A test decides pass or fail by real elapsed time — sleep 100 ms then assert, 'the callback must fire within 50 ms', a race between two timers — instead of waiting for the actual event. On a busy CI machine the scheduler shifts which timer wins, so correct code fails: a flaky test.

Example

The test sleeps 100 ms and then asserts the callback was called; it passes locally and fails on a loaded build machine where the callback fires at 130 ms.

Not to be confused with

Excludes real production timeout bugs, assertions about fixed time boundaries under a controlled clock, tests interfering through shared state (Test Runs Delete Each Other's Data), and screenshot tests sensitive to font rendering.

Discovered by

Field notes · 9