Urgent.News

What's breaking now, across thousands of outlets.

Tech

48-Hour Field Notes: Catching a Flake That Only Fails on Someone Else's Machine

48-Hour Field Notes: Catching a Flake That Only Fails on Someone Else's Machine Every team has one test that passes on your laptop and fails somewhere else, and after the third "works for me" it stops being a test and becomes folklore. I gave myself 48 hours to make one of those flakes boring, and the only thing I refused to accept was a fix I could not reproduce on demand. What follows is what I…

The author recounts a 48-hour investigation to identify a test that passes on their local machine but fails on another. The first hour was dedicated to freezing the failing run and capturing its environment in a snapshot. After six hours, the author discovered that the failure was not due to the code but rather certain conditions.

This led to creating a matrix of different conditions to test against. The author used a tool called MonkeyCode to generate candidate causes for the failure based on captured artifacts, excluding personal knowledge of the code. The hypotheses were then tested and either eliminated quickly or rewrote the code. The author moved the reproduction to a clean machine and found that the failure was caused by environment drift.

The author then shared the harness they used for the investigation, which could be customized for similar failures.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Monday 14 September →