From e56c73da3ad6672b194222486fdb5acfc4d7e658 Mon Sep 17 00:00:00 2001 From: forrestlinfeng Date: Wed, 23 Sep 2026 15:18:28 +0800 Subject: [PATCH] Prove the step did not wait by what it carries, not by a stopwatch 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 --- test/apply.test.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/apply.test.js b/test/apply.test.js index 9311f59..c826ea5 100644 --- a/test/apply.test.js +++ b/test/apply.test.js @@ -262,11 +262,9 @@ test('a search slower than the wait budget injects itself instead of holding the const { ctx, listeners } = fakeContext(); apply(ctx, Config({ projectDir, proxyPort: server.address().port, assetPrimeWaitMs: 20 })); const { agent, injected } = fakeAgent({ cwd: projectDir }); - const started = Date.now(); const primed = await primedBy(listeners, agent); - assert.ok(Date.now() - started < 120, 'the step waited for the slow search'); - assert.deepEqual(primed, []); + assert.deepEqual(primed, [], 'a step that waited for the slow search would carry its strategy'); await untilInjected(injected, 1); assert.match(injected[0].content[0].text, /Strategy reused from Gene sha256:slow/); assert.match(injected[0].content[0].text, /^1\. Arrived late\.$/m);