Skip to content

Prove the step did not wait by what it carries, not by a stopwatch - #22

Merged
forrestlinfeng merged 1 commit into
mainfrom
fix/drop-the-stopwatch-assertion
Sep 23, 2026
Merged

forrestlinfeng merged 1 commit into
mainfrom
fix/drop-the-stopwatch-assertion

Conversation

@forrestlinfeng

Copy link
Copy Markdown
Contributor

What

Removes a wall-clock assertion from the slow-prime test.

Why

assert.ok(Date.now() - started < 120, 'the step waited for the slow search');

The stub server answers in 150ms, so this is a 30ms margin on shared CI. It went red on main immediately after #21 and passed on a rerun — a test reporting the runner's load rather than the code.

#21 made the suite heavier (evolver-core is imported for the root-event write), so a margin that was always thin was going to keep flaking.

Nothing is lost

The next line already proves it:

assert.deepEqual(primed, [], 'a step that waited for the slow search would carry its strategy');

A step that waited would return the strategy inline. Verified by sabotage: raising assetPrimeWaitMs from 20 to 5000 — so the step genuinely does wait — still fails the test with the stopwatch gone.

Test count unchanged at 91.

🤖 Generated with Claude Code

The slow-prime test asserted the step returned within 120ms against a server
that answers in 150ms -- a 30ms margin on shared CI. It went red on main right
after #21 and passed on a rerun, which is the definition of a test that reports
the runner's load rather than the code.

The assertion below it already proves the thing: a step that waited for the
slow search would come back carrying its strategy, so an empty `primed` is the
evidence. Raising the wait budget until the step really does wait still fails
the test with the stopwatch gone.

#21 made the suite heavier -- evolver-core is imported for the root-event
write -- so a margin that was always thin was going to keep flaking.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@forrestlinfeng
forrestlinfeng merged commit 3486d11 into main Sep 23, 2026
4 checks passed
@forrestlinfeng
forrestlinfeng deleted the fix/drop-the-stopwatch-assertion branch September 23, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant