test(desktop): assert the tracer contract before the timing budget

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 <noreply@anthropic.com>
Signed-off-by: Max Lampert <maxwell@squareup.com>
This commit is contained in:
Max Lampert
2026-08-25 02:29:45 -07:00
parent 83eb45c8ee
commit 559e1e4ec7

View File

@@ -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();