lecture 16 of 190 completed

Diagnosing a failure you cannot reproduce

It fails in CI and passes a hundred times locally. A method beats guessing, and this is the method.

What you'll learn

  • How to classify a failure before investigating it
  • How to find the test that broke another one
  • How to reproduce a race by making conditions worse

A test fails on the build server. You run it on your machine a hundred times, and it passes every time. The machine it failed on no longer exists. All you have is what the run recorded.

Guessing wastes days here. A method does not. This lecture is that method.

Reading example. Harbour Ferries is a fictional ferry timetable app. You can read these examples here.

Start by sorting the failure into one of four kinds. Each kind has a different next step.

  1. It fails alone, every time, but only on the build server. Something about the environment differs. This kind is usually the easiest to fix.
  2. It passes alone, but fails when the whole suite runs. Another test is changing something this test depends on. The environment does not matter.
  3. It fails now and then, everywhere, including on your machine. A race: two things happen in an order that is usually right and sometimes wrong.
  4. It started failing on a certain day. Something changed. Find the change.

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →