🔧 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 <filip.sajdak@siili.com>
This commit is contained in:
Filip Sajdak 2026-11-10 11:33:42 +01:00 committed by GitHub
parent 90d98b1989
commit ee3e2a0e61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 },
},
},