From 37bdf902cc6e47bf662f9f382f4086a7936e1e8e Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Mon, 28 Sep 2026 10:08:07 +0000 Subject: [PATCH] fix(e2e): fast-forward the phases spec at MID scale; retry set-health on transient 500 --- e2e/phases.spec.ts | 1 + e2e/right-pane.spec.ts | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/e2e/phases.spec.ts b/e2e/phases.spec.ts index 805ec9c..3257041 100644 --- a/e2e/phases.spec.ts +++ b/e2e/phases.spec.ts @@ -167,6 +167,7 @@ test('marker shows the takeoff and landing phases on a dispatched leg', async ({ // --- Landing: fast-forward through the cruise to just before the landing window, then drop back // to OBS so the hold at the destination gate is observable. --- const landingStart = T_dep + ph.takeoffMs + ph.cruiseMs; + await setScale(page, MID); // fast-forward through takeoff hold + cruise (pure arrival wait) await expect.poll(async () => { const body = await getState(page); const p = body.planes.find((x) => x.id === STARTER)!; diff --git a/e2e/right-pane.spec.ts b/e2e/right-pane.spec.ts index d17633d..6c5edb9 100644 --- a/e2e/right-pane.spec.ts +++ b/e2e/right-pane.spec.ts @@ -162,7 +162,13 @@ async function flyHomeViaApi(page: Page): Promise { // v0.39.0 (ISS-069): wear accumulates across the shared CI DB — restore full health and clear any // active repair gate from an interrupted run before the steps below act on the starter, so the // farthest-flyable picker and fuel pins never see a worn or broken plane. - expect((await page.request.post('/api/test/set-health', { data: { planeId: 'plane-starter', health: 100, repairUntilMs: 0 } })).status()).toBe(200); + // ISS-127-style transient: test hooks intermittently 500 under dind load — retry briefly instead of failing. + for (let attempt = 1; ; attempt++) { + const healthRes = await page.request.post('/api/test/set-health', { data: { planeId: 'plane-starter', health: 100, repairUntilMs: 0 } }); + if (healthRes.status() === 200) break; + if (attempt >= 3) throw new Error(`/api/test/set-health returned ${healthRes.status()} after 3 attempts`); + await page.waitForTimeout(500); + } // Fast-forward any leftover leg / repositioning flight (a few seconds real time worst case at 1000×). await setScale(page, SCALE); await expect.poll(async () => {