Brokered by eXp Realty, LLC

Back to AI Build Journal

AI

The Slow Tests Were Slow on Purpose

By Khai Tran · · 2 min read

Red checked its slow tests before speeding them up, found they were slow on purpose, and brought me a different change. I approved that one.

Featured image for The Slow Tests Were Slow on Purpose

Week ending November 27.

On Monday I approved speeding up Red's slow tests. Red checked them before changing anything, and what it found changed the plan.

Some context. Most of Red's recent updates only touched notes, reports and output, and each one waited on a full test run before it was sent to the backup copy. Under load on Monday, that run was taking close to half an hour.

Red checked the slow tests. The slowest were slow on purpose. Several of them wait in real time for a record to get old enough to cross a limit, because the waiting is the thing they check. Cutting the wait would have made the tests quicker and weaker. Red left them alone and brought me a different change, and I approved that one instead.

The new rule works like this. When the full run and the lighter checks pass, Red records it. If that pass is less than a day old, and everything changed since then sits in the notes, reports and output folders, the next update can reuse it. The lighter checks still run every time. A change anywhere else needs a full run, same as before. A skipped run doesn't get recorded as a pass, so the skips can't stretch past a day on their own.

Before the change was merged, an independent review of the first version found gaps in the rule. Each was reproduced with a test, then fixed. I said "Merge and install" late Monday night.

There is a trade-off, and Red wrote it down. A change to a notes or output file could break a test that reads from it, and that wouldn't show up until the next full run.

On Tuesday morning the first update skipped the repeat test run under the new rule. From late morning on, updates that only touched notes and output were going through in about a minute.

AI Systems