From 23ac3a9c1919208a961e098abdafb17d88196fe4 Mon Sep 17 00:00:00 2001 From: Justin Parker Date: Thu, 5 Nov 2026 20:05:02 -0800 Subject: [PATCH] Fix two Ubuntu flakes: try more road for a Bounce Road rival, and wait for the board's focus before the last F press AI Assisted --- scripts/test-web-console-activities-bounce-game.mjs | 5 ++++- scripts/test-web-console-in-app.mjs | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/test-web-console-activities-bounce-game.mjs b/scripts/test-web-console-activities-bounce-game.mjs index 74cb002..43d7298 100644 --- a/scripts/test-web-console-activities-bounce-game.mjs +++ b/scripts/test-web-console-activities-bounce-game.mjs @@ -193,7 +193,10 @@ const eventsOf = (round, type) => round.events.filter((e) => e.type === type); // A rival of `kind` put at (x, d), still and on the ground, going nowhere on // its own. function bounceRival(round, kind, x, d, over = {}) { - const car = bounce.spawnRival(round, kind, steady, round.cars[0].d + 300); + // A rival only spawns on plain road, and the road is generated at random: a crack or a bridge can + // sit at the first spot tried, so try further along until one takes. The rival is moved anyway. + let car = null; + for (let at = round.cars[0].d + 300; !car && at < round.cars[0].d + 3000; at += 40) car = bounce.spawnRival(round, kind, steady, at); assert.ok(car, `a ${kind} spawns`); Object.assign(car, { x, d, v: 0, tv: 0, vx: 0, kx: 0, air: 0, tx: x, lane: x, hopIn: 1e9, dropIn: 1e9, mode: "calm", ...over }); return car; diff --git a/scripts/test-web-console-in-app.mjs b/scripts/test-web-console-in-app.mjs index f50e7ee..ec8a20a 100644 --- a/scripts/test-web-console-in-app.mjs +++ b/scripts/test-web-console-in-app.mjs @@ -370,6 +370,9 @@ test("framed, an Activities game in full screen asks the app for the whole scree await s.page.keyboard.press("f"); await s.page.keyboard.press("Escape"); assert.deepEqual(await told(), [true, false, true, false], "F and Esc each give it back"); + // The focus comes back to the board a moment after leaving full screen: an F pressed before + // that goes nowhere (seen on slow runners). + await s.page.waitForFunction(() => document.activeElement && document.activeElement.id === "activities-board"); await s.page.keyboard.press("f"); s.post({ items: [{ id: "q2", kind: "text", title: "Who uses it", body: "Who opens the export?" }], agent: { status: "waiting" } }); // Wait for both new messages: the list already ends in false, so checking only its last item passed at once.