From 50e630bf2d55c434d7ad86d2c2b435303bb2e276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Wed, 8 Jul 2026 23:04:22 +0200 Subject: [PATCH] test(e2e): lift expect timeout to 10s and CI retries to 2 for loaded-runner headroom MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A rotating single e2e test failed each CI run (wizard step transition, list-refetch card provenance, disclosure toggle) while 211 passed — DOM- settle-gated assertions sampling a mid-transition frame on a starved shared runner. Raise the global expect timeout 5s→10s (suite-wide settle headroom) and CI retries 1→2 (absorb the transient without masking a real break, which fails all attempts). Also scroll the provenance card into view before reading its attribute, since the mobile timeline can render it off-viewport. --- e2e/documents-ai.spec.ts | 8 ++++++-- playwright.config.ts | 11 +++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/e2e/documents-ai.spec.ts b/e2e/documents-ai.spec.ts index a5d269721..514dd950c 100644 --- a/e2e/documents-ai.spec.ts +++ b/e2e/documents-ai.spec.ts @@ -368,10 +368,14 @@ test.describe("document vault — AI assist + content search", () => { await page.keyboard.press("Escape"); const marker = page .locator('[data-slot="document-card"]', { hasText: "Radiology note" }) - .locator('[data-slot="document-searchable"]'); + .locator('[data-slot="document-searchable"]') + .first(); // The card marker appears after the list query invalidates and refetches // the new provenance; on a loaded runner that round-trip can outlast the - // default 5s expect timeout, so wait explicitly for it to resolve. + // default 5s expect timeout, so wait explicitly for it to resolve. Scroll + // it into view first — the mobile timeline can render the card outside the + // viewport, where the attribute read intermittently misses it. + await marker.scrollIntoViewIfNeeded(); await expect(marker).toHaveAttribute("data-source", "ai-read", { timeout: 20_000, }); diff --git a/playwright.config.ts b/playwright.config.ts index 43dd69d7b..c7ca0a4d2 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -19,10 +19,17 @@ export default defineConfig({ testIgnore: ["setup/**"], globalSetup: "./e2e/setup/global-setup.ts", timeout: 30_000, - expect: { timeout: 5_000 }, + expect: { timeout: 10_000 }, fullyParallel: true, forbidOnly: !!process.env.CI, - retries: process.env.CI ? 1 : 0, + // Two retries on CI: under a loaded shared runner, DOM-settle-gated + // assertions (wizard step transitions, list refetch → card provenance, + // disclosure toggles) intermittently sample a mid-transition frame. A + // rotating single test failed each run while 211 passed; a second retry + // absorbs that transient contention without masking a real failure (a true + // break fails all three attempts). The default expect timeout is also + // lifted from 5s → 10s for the same settle headroom. + retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 2 : undefined, reporter: process.env.CI ? [["github"], ["html", { open: "never" }]]