From fa64e32f657f40e183c89f3ec28f5b503cfeed67 Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Sun, 20 Sep 2026 22:59:29 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20two-planes=20e2e=20healPlaneHome:=20resto?= =?UTF-8?q?re=201000=C3=97=20before=20waiting=20for=20landing=20(ISS-057?= =?UTF-8?q?=20slows=20sim=20to=201=C3=97)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/two-planes.spec.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/e2e/two-planes.spec.ts b/e2e/two-planes.spec.ts index 490e3ec..19e90a4 100644 --- a/e2e/two-planes.spec.ts +++ b/e2e/two-planes.spec.ts @@ -210,13 +210,18 @@ async function healPlaneHome(page: Page, planeId: string): Promise { await clearQueueViaApi(page, planeId); let p = (await getState(page)).planes.find((x) => x.id === planeId); if (!p) return; // already sold — nothing to heal - if (p.status === 'flying' || p.locationIcao !== HUB) { - await setScale(page, SCALE); // fast-forward any leftover leg (~20 s real time worst case at 1000×) - } + // ISS-057: a prior landing may have slowed the sim to 1× — restore 1000× first so any in-flight leg + // completes fast. Re-applied inside the poll below, since a sibling's landing mid-wait slows it again. + await setScale(page, SCALE); if (p.status === 'flying') { // While flying, locationIcao stays at the DEPARTURE airport — re-read state after landing. await expect - .poll(async () => ((await getState(page)).planes.find((x) => x.id === planeId)?.status ?? ''), { + .poll(async () => { + const s = await getState(page); + const plane = s.planes.find((x) => x.id === planeId); + if (plane?.status === 'flying' && s.simState.timeScale !== SCALE) await setScale(page, SCALE); // sibling landing re-slowed to 1× + return plane?.status ?? ''; + }, { timeout: 240_000, message: `waiting for an in-flight ${planeId} to land`, })