mirror of
https://github.com/block/buzz.git
synced 2026-10-29 21:41:33 +00:00
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user