From 8d116af35ff57c48b9c07c98c5c3240f71205988 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 13:26:06 +0000 Subject: [PATCH] fix(test): resolve CI timeout in webseed-playback e2e test - Switched from `waitUntil: 'networkidle'` to `domcontentloaded` + explicit selector wait to avoid flakiness from background polling. - Added fail-fast logic to detect "Failed to load content" view states. - Added error logging to capture page state if the test times out. Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> --- tests/e2e/webseed-playback.spec.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/e2e/webseed-playback.spec.ts b/tests/e2e/webseed-playback.spec.ts index 21303ca4..cf9f4daf 100644 --- a/tests/e2e/webseed-playback.spec.ts +++ b/tests/e2e/webseed-playback.spec.ts @@ -7,10 +7,25 @@ test.describe("Webseed Stream Playback", () => { const MAGNET_URI = `magnet:?xt=urn:btih:${INFO_HASH}`; test.beforeEach(async ({ page }) => { - await page.goto("/", { waitUntil: "networkidle" }); - await page.waitForFunction(() => { - return !!document.getElementById('videoList'); - }); + // networkidle can be flaky if background polling/relays are active. + // We rely on explicit selector waits instead. + await page.goto("/", { waitUntil: "domcontentloaded" }); + + try { + // Wait for either the video list (success) or the error message (failure) + await Promise.race([ + page.waitForSelector('#videoList', { timeout: 30000 }), + page.waitForSelector('.text-critical-strong', { timeout: 30000 }).then(async (el) => { + const text = await el?.innerText(); + throw new Error(`View load failed with message: ${text}`); + }) + ]); + } catch (error) { + // If timeout occurs, capture page content for debugging + const body = await page.innerHTML('body'); + console.error('Test failed to load video list. Body content:', body.substring(0, 500)); + throw error; + } }); test("plays directly from HTML link (CDN mode)", async ({ page }) => {