From 99ddf0db5d6b922138973de61be368dde707f548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 13 Sep 2026 20:58:04 +0200 Subject: [PATCH] test(e2e): give an unnavigated page an origin before a session call The setup flow specs answer questions through these helpers before their first real navigation. That case still went through page.request, which shares the runner's keep-alive agent, and a stale socket failed an answer with read ECONNRESET on the dependency update branches. The page now opens the public version endpoint first and sends the call with its own fetch. --- e2e/setup-flow-helpers.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/e2e/setup-flow-helpers.ts b/e2e/setup-flow-helpers.ts index 9d6fd7872..cec509bdb 100644 --- a/e2e/setup-flow-helpers.ts +++ b/e2e/setup-flow-helpers.ts @@ -68,9 +68,11 @@ export async function acceptAndSetUp(page: Page): Promise { * Every Playwright API context in the runner shares one keep-alive agent, * and it can hand out a socket the server already closed on its idle * timeout; the call then dies with `read ECONNRESET` and CI counts the retry - * as a failure. The page opens its own connection. Before the first - * navigation there is no origin to fetch against, so that case keeps the - * API context. + * as a failure. The page opens its own connection. A page that has not + * navigated yet has no origin to fetch against, so it first opens the public + * version endpoint: the specs call these helpers before their first real + * navigation, and routing that case back through the API context is what + * kept the flake alive. */ async function sessionCall( page: Page, @@ -79,8 +81,7 @@ async function sessionCall( body?: unknown, ): Promise<{ status: number; json: unknown }> { if (!page.url().startsWith("http")) { - const res = await page.request.fetch(path, { method, data: body }); - return { status: res.status(), json: await res.json().catch(() => null) }; + await page.goto("/api/version", { waitUntil: "domcontentloaded" }); } return page.evaluate( async ({ method, path, body }) => {