From 2148cbdd01b0b5b5e14767dc2e4f938f7aeb222f Mon Sep 17 00:00:00 2001 From: Patrick Debois <70908+jedi4ever@users.noreply.github.com> Date: Thu, 3 Dec 2026 02:51:22 +0100 Subject: [PATCH] Let frames in flight finish before the nudge test jumps the clock The nudge's smoke test moves the page's clock on by a minute while inside a booth. That clock is every square's too, so a square whose frame was still being drawn when it jumped was stopped as hung, and the test failed on the console errors: once in three runs locally, and three times in five on pull requests since a heavier booth landed. The test now gives every frame asked for before the jump its whole budget of real time first. Co-Authored-By: Claude Fable 5.2 --- smoke/nudge.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/smoke/nudge.spec.ts b/smoke/nudge.spec.ts index be664d2f..c7a4b14a 100644 --- a/smoke/nudge.spec.ts +++ b/smoke/nudge.spec.ts @@ -7,6 +7,9 @@ import { watch } from './support/carnival'; * page's clock is moved on rather than waited out, so the test stays quick. */ +/** How long a square's frame may take before it is stopped: HANG_MS in src/northpole/frame.ts. */ +const DRAW_BUDGET_MS = 1000; + /** Opens the map at jedi4ever's booth, goes in with E, lingers, and comes back out. */ async function enjoyABooth(page: import('@playwright/test').Page) { await page.clock.install(); @@ -19,6 +22,10 @@ async function enjoyABooth(page: import('@playwright/test').Page) { await expect(page).toHaveURL(/#\/booth\/jedi4ever$/); // Inside for real, so the time moved on counts as time spent in the booth. await expect(page.locator('.map-frame')).toHaveAttribute('data-visiting', 'booth:jedi4ever'); + // The page's clock is every square's too, and a square stopped when its frame took over + // DRAW_BUDGET_MS can't tell a jump from a hang. So each frame asked for before the jump gets + // its whole budget of real time first: going inside is when the page is busiest. + await page.waitForTimeout(DRAW_BUDGET_MS + 250); await page.clock.fastForward('01:05'); await page.keyboard.press('Escape'); await expect(page.locator('.visit')).toHaveCount(0);