test(fast-browser): retain per-operation timing and failure costs

This commit is contained in:
jb
2026-09-21 13:33:51 -04:00
parent 6a725c1f47
commit 12a6bb6afb
2 changed files with 48 additions and 9 deletions
@@ -6,6 +6,7 @@ import {
pairedArmOrder,
safeFailure,
summarizeBenchmarkAttempts,
timingDelta,
validWorkerCounters,
summarizeTimings,
validateBenchmarkOptions,
@@ -27,6 +28,11 @@ test("timing aggregation reports bounded p50 and p95 without wall-clock assumpti
assert.deepEqual(summarizeTimings([]), { count: 0, p50: null, p95: null });
});
test("transport timer deltas preserve bounded operation names and failed costs", () => {
assert.deepEqual(timingDelta({ observe: 12, closeTab: 4 }, { observe: 19, closeTab: 4, waitPopup: 8 }), { observe: 7, waitPopup: 8 });
assert.deepEqual(timingDelta({ observe: 10 }, { observe: 9 }), {});
});
test("paired order alternates AB and BA while retaining failed attempts", () => {
assert.deepEqual(pairedArmOrder(1), ["baseline", "optimized"]);
assert.deepEqual(pairedArmOrder(2), ["optimized", "baseline"]);