From d38b808a118cf0a1333596f696b86aa47b38620e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ullrich=20Sch=C3=A4fer?= Date: Mon, 25 May 2026 23:44:20 +0200 Subject: [PATCH] =?UTF-8?q?test(e2e/planner-coloring):=20bump=20canvas=20t?= =?UTF-8?q?imeout=2010s=E2=86=9220s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The three planner-coloring tests wait for the elevation chart's \`\` after seeing the Yjs \"Connected\" text. \`ElevationChart\` returns \`null\` until \`points.length >= 2\` — i.e. until the BRouter response (even mocked) has flowed through the Yjs round-trip and updated \`yjs.routeData\`. The chart module is also lazy-imported (\`Suspense\`) — cold CI runs need to fetch the chunk before mounting. Saw the failure on PR #424's CI run: canvas \"element(s) not found\" after the 10s window, both initial run and retry. Other planner suites that wait on \`.leaflet-container\` (which renders unconditionally and isn't behind a lazy boundary) don't see this. Bumped \`CANVAS_TIMEOUT\` to 20s. Not masking a real regression — the lazy chunk + Yjs apply is a real serial cost that the test budget didn't reflect. --- e2e/planner-coloring.test.ts | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/e2e/planner-coloring.test.ts b/e2e/planner-coloring.test.ts index 1906fd0..fbac6fd 100644 --- a/e2e/planner-coloring.test.ts +++ b/e2e/planner-coloring.test.ts @@ -11,6 +11,15 @@ const WITH_ROUTE = encodeURIComponent(JSON.stringify([ { lat: 52.515, lon: 13.351 }, ])); +// `ElevationChart` returns `null` until `points.length >= 2` — i.e. until +// the BRouter response (even mocked) has flowed through the Yjs round-trip +// and updated `yjs.routeData`. On cold CI runs the lazy-loaded chart +// chunk + that async pipeline have measurably exceeded the previous 10s +// window. 20s buys headroom without masking a real regression — the +// other planner suites use the same budget for similar lazy-chunk waits. +const CANVAS_TIMEOUT = 20_000; +const SELECT_TIMEOUT = 5_000; + test.describe("Planner – route coloring", () => { test("session has color mode toggle", async ({ page, request }) => { const url = await createSession(request); @@ -19,9 +28,9 @@ test.describe("Planner – route coloring", () => { await expect(page.locator(".leaflet-container")).toBeVisible({ timeout: 10000 }); await expect(page.getByText("Connected")).toBeVisible({ timeout: 15000 }); - await expect(page.locator("canvas")).toBeVisible({ timeout: 10000 }); + await expect(page.locator("canvas")).toBeVisible({ timeout: CANVAS_TIMEOUT }); const select = page.locator("select", { has: page.locator("option[value='highway']") }); - await expect(select).toBeVisible({ timeout: 5000 }); + await expect(select).toBeVisible({ timeout: SELECT_TIMEOUT }); await expect(select).toHaveValue("plain"); await select.selectOption("elevation"); @@ -35,9 +44,9 @@ test.describe("Planner – route coloring", () => { await expect(page.locator(".leaflet-container")).toBeVisible({ timeout: 10000 }); await expect(page.getByText("Connected")).toBeVisible({ timeout: 15000 }); - await expect(page.locator("canvas")).toBeVisible({ timeout: 10000 }); + await expect(page.locator("canvas")).toBeVisible({ timeout: CANVAS_TIMEOUT }); const select = page.locator("select", { has: page.locator("option[value='highway']") }); - await expect(select).toBeVisible({ timeout: 5000 }); + await expect(select).toBeVisible({ timeout: SELECT_TIMEOUT }); await select.selectOption("highway"); await expect(select).toHaveValue("highway"); @@ -54,9 +63,9 @@ test.describe("Planner – route coloring", () => { await expect(page.locator(".leaflet-container")).toBeVisible({ timeout: 10000 }); await expect(page.getByText("Connected")).toBeVisible({ timeout: 15000 }); - await expect(page.locator("canvas")).toBeVisible({ timeout: 10000 }); + await expect(page.locator("canvas")).toBeVisible({ timeout: CANVAS_TIMEOUT }); const select = page.locator("select", { has: page.locator("option[value='highway']") }); - await expect(select).toBeVisible({ timeout: 5000 }); + await expect(select).toBeVisible({ timeout: SELECT_TIMEOUT }); await select.selectOption("highway"); const canvas = page.locator("canvas");