From ee3e2a0e61c00889ea4ab48c812d30b9154f3379 Mon Sep 17 00:00:00 2001 From: Filip Sajdak Date: Tue, 10 Nov 2026 11:33:42 +0100 Subject: [PATCH] :wrench: Keep the CI expect timeout in the default and ds e2e projects (#12922) The Playwright config gives the retrying expects 40 seconds on CI and 5 seconds elsewhere, but the default and ds projects set their own expect block for the screenshot tolerance, and a project block replaces the top-level one instead of merging with it. On CI those projects have run with Playwright's 5 second default. That is too short for the first dashboard load on a busy runner, where the dashboard module is fetched lazily: specs that wait for the dashboard heading time out and pass on the retry (flaky), or fail after the retries. In the shard of one recent run that was 7 flaky and 4 failed specs out of 112, and develop itself failed the same families of specs on several runs the same day. Name the timeout once and repeat it in both projects. A probe config that imports this one and polls a condition that never holds reports 40000 ms for both projects with this change, and 5000 ms without it. The render-wasm project already repeats its own value. AI-assisted-by: claude-opus-5-5 AI-assisted-by: claude-sonnet-5-5 Signed-off-by: Filip Sajdak --- frontend/playwright.config.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/playwright.config.js b/frontend/playwright.config.js index 087e6ba56f..a7e5496a7a 100644 --- a/frontend/playwright.config.js +++ b/frontend/playwright.config.js @@ -11,6 +11,13 @@ const userAgent = platform === 'darwin' ? "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" : undefined; +// Default timeout of the retrying expects (toBeVisible and friends). CI +// runners are slower and the first load of a page fetches its module, so +// they get more time. A project that sets its own `expect` replaces the +// top-level one instead of merging with it, so every such project has to +// repeat this timeout or it falls back to Playwright's 5 seconds. +const expectTimeout = process.env.CI ? 40000 : 5000; + /** * @see https://playwright.dev/docs/test-configuration */ @@ -29,7 +36,7 @@ export default defineConfig({ timeout: 80000, expect: { - timeout: process.env.CI ? 40000 : 5000, + timeout: expectTimeout, }, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ @@ -58,6 +65,7 @@ export default defineConfig({ }, snapshotPathTemplate: "{testDir}/{testFilePath}-snapshots/{arg}.png", expect: { + timeout: expectTimeout, toHaveScreenshot: { maxDiffPixelRatio: 0.001, }, @@ -70,6 +78,7 @@ export default defineConfig({ use: { ...devices["Desktop Chrome"], colorScheme: "dark" }, testDir: "./playwright/ui/visual-specs", expect: { + timeout: expectTimeout, toHaveScreenshot: { maxDiffPixelRatio: 0.005 }, }, },