From 3c6abde691414e5a3b0a55886257f1863c49c846 Mon Sep 17 00:00:00 2001 From: Aleksandr Shevchuk Date: Fri, 23 Oct 2026 12:23:11 +0300 Subject: [PATCH] test: pace the early-boot pack test at 32 kB/s, so a slow runner has two seconds The dev server sends 64 kB at a time, and the download first publishes its forward index at 256 kB. The frame may boot from the fourth slice, and the download ends with the fifth, so the test had one slice's interval to plan, fetch and attach the pack's parts: half a second at 128 kB/s. Passing runs used 0.16 to 0.43 s of it, and a Firefox runner on main used more, so the load went through `indexing`. At 32 kB/s the interval is two seconds, and the test takes about six instead of two. Closes #75 Co-Authored-By: Claude Opus 5.5 --- packages/player/tests/browser/pack.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/player/tests/browser/pack.test.ts b/packages/player/tests/browser/pack.test.ts index 6a33bbad..a3f10a04 100644 --- a/packages/player/tests/browser/pack.test.ts +++ b/packages/player/tests/browser/pack.test.ts @@ -192,8 +192,12 @@ describe('the library pack, split into parts', () => { // Paced, the archive's library folder arrives seconds before its media: the parts are // planned and attached then, and the frame boots with them before the download ends. The // pack's 1.2 needs nothing the package's own 1.0 did, so the extra library stays out. + // The server sends 64 kB at a time and the download first publishes its index at 256 kB, so the + // frame may boot from the fourth slice and has until the fifth, one slice's interval, to plan, + // fetch and attach the parts: half a second at 128 kB/s, which a slow runner did not make + // (#75), and two at 32 kB/s. const states: string[] = [] - const { player, result } = await settle(fresh(`${FIXTURES.needsDependencyNoRange}?throttle=131072`, 'paced'), withPack(), (each) => + const { player, result } = await settle(fresh(`${FIXTURES.needsDependencyNoRange}?throttle=32768`, 'paced'), withPack(), (each) => each.addEventListener('statechange', (event) => states.push((event as CustomEvent<{ state: string }>).detail.state)) ) if (!result.ok) expect.fail(`${result.detail.code} — ${result.detail.message}`)