From 559e1e4ec701a36cb4bd40530a5fab226e4d98cd Mon Sep 17 00:00:00 2001 From: Max Lampert Date: Tue, 25 Aug 2026 02:29:45 -0700 Subject: [PATCH] test(desktop): assert the tracer contract before the timing budget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Blind-review round 15 (Fable xhigh) finding: a clean measure recorded behind the held chunk — the exact regression under test — clears the start mark and nulls elapsedSinceClick, so the timing-budget assertion failed first with a 'rerun, not a tracer bug' message stating the opposite of the truth. The contract assertion now runs first. Co-Authored-By: Claude Fable 5 Signed-off-by: Max Lampert --- desktop/tests/e2e/switch-settle-after-paint.spec.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/desktop/tests/e2e/switch-settle-after-paint.spec.ts b/desktop/tests/e2e/switch-settle-after-paint.spec.ts index a6c04bf990..0edc9ae931 100644 --- a/desktop/tests/e2e/switch-settle-after-paint.spec.ts +++ b/desktop/tests/e2e/switch-settle-after-paint.spec.ts @@ -130,14 +130,18 @@ test("settle waits for a delayed lazy channel-pane chunk", async ({ page }) => { elapsedSinceClick: start ? performance.now() - start.startTime : null, }; }, SWITCH_MEASURE); - expect( - early.elapsedSinceClick, - "harness overhead consumed the tracer's settle deadline — timing, not a tracer bug", - ).toBeLessThan(4_500); + // Order matters: a clean measure recorded behind the held chunk — the + // regression under test — clears the start mark, nulling elapsedSinceClick. + // Asserting the budget first would then fail with a "rerun, not a tracer + // bug" message that states the opposite of the truth. expect( early.cleanMeasures, "no clean settle may be recorded while the pane chunk is suspended", ).toBe(0); + expect( + early.elapsedSinceClick, + "harness overhead consumed the tracer's settle deadline — timing, not a tracer bug", + ).toBeLessThan(4_500); releaseChunk();