import { test, type PlaywrightWorkerArgs } from "@playwright/test"; // The e2e server is `next dev`: the first request to a route COMPILES it, and // the article page pulls in a large graph (common's report views, markdown, // the evidence resolver). On a loaded machine that first compile alone has // taken over 30 s -- a test's whole budget -- so each spec file that visits // these routes compiles them first, in a beforeAll with its own timeout. export const WARM_TIMEOUT = 180_000; export async function warm(playwright: PlaywrightWorkerArgs["playwright"], urls: string[]) { const ctx = await playwright.request.newContext({ baseURL: test.info().project.use.baseURL }); try { for (const u of urls) await ctx.get(u, { timeout: 170_000 }); } finally { await ctx.dispose(); } }