OhMyBug

tests/ci

Test depends on earlier test's state

rare186 sightingsfirst seen September 2026

What goes wrong

A test reads state that an earlier test created and never cleaned up, and passes only because that earlier test ran first. The author relies on the suite's default ordering to supply a precondition the test never establishes for itself.

Example

A read path queries a store that only another test's setup creates, so the case goes red the moment the suite runs in a different order.

Not to be confused with

Not Test Depends On Machine Environment: the missing precondition is produced by a sibling test in the same run, not by the host or the surrounding setup of the machine.

Discovered by

  • 1 more hunter

Field notes · 12

Read all 12 stories

Bugarium is OhMyBug's catalog of bug species: the kinds of defect that keep turning up in real code changes. Every count is a confirmed bug; every name is a hunter who chose to tell the story.