From 809801f1fb3d140742d493dcc169ddfb113f2141 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 3 Nov 2026 11:52:10 +0800 Subject: [PATCH] gui tests: every short default timeout gets a minute to load the page (#4787) nav-timeout was red on main: five page and panel setDefaultTimeout calls had no setDefaultNavigationTimeout beside them, so on a busy machine their first page.goto had only 5s or 8s: - account-rows-fit (834c6c7df) - profile-rename (1cb4d4301) - quota-caption-contrast, page and panel (95a61a5d1) - window-visibility (dfe868a1e) Each now also gets setDefaultNavigationTimeout(60000), as the other files already do. Only the time a page gets to load changes. Clicks and waits keep their short limit. Run on mote at 37cc86b3b plus this change: nav-timeout, account-rows-fit, profile-rename, quota-caption-contrast and window-visibility at --test-concurrency=2, chromium and webkit: 48 of 48 pass. Red on the old code: nav-timeout listed these five calls at origin/main 84da86ebd (comment on #4787). Not tried: the whole GUI suite. Nothing outside these test files changes. --- internal/gui/tests/account-rows-fit.test.cjs | 1 + internal/gui/tests/profile-rename.test.cjs | 1 + internal/gui/tests/quota-caption-contrast.test.cjs | 2 ++ internal/gui/tests/window-visibility.test.cjs | 1 + 4 files changed, 5 insertions(+) diff --git a/internal/gui/tests/account-rows-fit.test.cjs b/internal/gui/tests/account-rows-fit.test.cjs index b1a3b6b4c..878f717f9 100644 --- a/internal/gui/tests/account-rows-fit.test.cjs +++ b/internal/gui/tests/account-rows-fit.test.cjs @@ -68,6 +68,7 @@ for (const engine of engines) { t.after(() => browser.close()); const page = await browser.newPage({ viewport: { width, height: 900 }, reducedMotion: "reduce" }); page.setDefaultTimeout(5000); + page.setDefaultNavigationTimeout(60000); const errors = []; page.on("pageerror", (e) => errors.push(e.message)); const reads = { n: 0 }; diff --git a/internal/gui/tests/profile-rename.test.cjs b/internal/gui/tests/profile-rename.test.cjs index 142f3a1d0..c9fb9c79d 100644 --- a/internal/gui/tests/profile-rename.test.cjs +++ b/internal/gui/tests/profile-rename.test.cjs @@ -65,6 +65,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", const w = words[lang], calls = [], errors = []; const page = await (await browser.newContext({ viewport: panel ? { width: 360, height: 420 } : { width: 900, height: 560 } })).newPage(); page.setDefaultTimeout(5000); + page.setDefaultNavigationTimeout(60000); page.on("pageerror", (e) => errors.push(e.message)); await page.route("**/*", server(lang, calls)); await page.goto("http://magpie.test/" + (panel ? "?mode=panel" : "")); diff --git a/internal/gui/tests/quota-caption-contrast.test.cjs b/internal/gui/tests/quota-caption-contrast.test.cjs index 0761b3504..66aabb183 100644 --- a/internal/gui/tests/quota-caption-contrast.test.cjs +++ b/internal/gui/tests/quota-caption-contrast.test.cjs @@ -84,6 +84,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", const errors = []; const page = await ctx.newPage(); page.setDefaultTimeout(8000); + page.setDefaultNavigationTimeout(60000); page.on("pageerror", (e) => errors.push(e.message)); await page.route("**/*", serve(lang, theme, true)); await page.goto("http://magpie.test/?view=usage"); @@ -102,6 +103,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", await ctx.addInitScript(() => { try { localStorage.setItem("magpie.panelTab", "usage"); } catch {} }); const panel = await ctx.newPage(); panel.setDefaultTimeout(8000); + panel.setDefaultNavigationTimeout(60000); await panel.route("**/*", serve(lang, theme, false)); await panel.goto("http://magpie.test/?mode=panel"); await panel.locator(".pq-card .pq-sub").first().waitFor(); diff --git a/internal/gui/tests/window-visibility.test.cjs b/internal/gui/tests/window-visibility.test.cjs index 1633602b6..797e34c20 100644 --- a/internal/gui/tests/window-visibility.test.cjs +++ b/internal/gui/tests/window-visibility.test.cjs @@ -36,6 +36,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", t.after(() => browser.close()); const page = await browser.newPage(); page.setDefaultTimeout(5000); + page.setDefaultNavigationTimeout(60000); await page.route("**/*", serve()); await page.goto("http://magpie.test/?view=providers"); await page.waitForFunction(() => typeof window.magpieWindowVisibility === "function");