From 265e9ac1d3cca4d65796666d30d3ceea1986d03b Mon Sep 17 00:00:00 2001 From: buky Date: Wed, 20 May 2026 11:50:15 +0200 Subject: [PATCH] fix(ci): increase Playwright webServer timeout for CI The E2E job in CI has been failing on every push to main since at least PR #99 (Phase 0e merge) with the same error: Error: Timed out waiting 120000ms from config.webServer. Root cause: Playwright's `webServer.timeout` was set to 120_000 ms (2 minutes), but the CI command is `pnpm build && pnpm start`, which has to run a full Next.js production build on a fresh CI runner. The build alone takes 5-15 minutes (4m 11s in the dedicated CI Build job, 15.3 min in the Docker build job). The 120-second window expires before the server can listen on port 3000, and Playwright aborts with the timeout error above. This was masked until now because: 1. The E2E job only runs on push to main (and labeled PRs), so PR-level CI is green even when main-level CI is red. 2. Railway's "Wait for CI" toggle was off, so deploys went through despite the red CI status on the main branch. After enabling "Wait for CI" in preparation for Phase 0b migrations, this latent issue became a hard block: Railway now refuses to deploy any new main commit until CI is green. Fix: bump `webServer.timeout` to 1_500_000 ms (25 minutes) when running under CI. The original 120s remains in place locally so fast feedback isn't lost when running `pnpm test:e2e` against `pnpm dev`. Comment in the config explains the asymmetry. Followups out of scope for this PR: - Caching the `.next` build output between CI Build and E2E jobs so the build doesn't have to run twice. This is the proper long-term fix; tracked separately. - Investigating why Next.js compile is 15 minutes inside Docker builds vs 4 minutes in the dedicated Build job (see PR #98 docs/rls-tech-debt.md item #1). Verification: - tsc --noEmit -p tsconfig.json: exit 0 - Only one file changed (playwright.config.ts). - No app code, no test files, no migrations touched. Risk: low. Worst case, the new 25-minute cap is still too short and we widen it further. Best case, CI goes green and we unblock Phase 0b deploy + future PRs. --- playwright.config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 72e5efc0..1d33a754 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -73,6 +73,12 @@ export default defineConfig({ command: process.env.CI ? "pnpm build && pnpm start" : "pnpm dev", port: 3000, reuseExistingServer: !process.env.CI, - timeout: 120_000, + // CI: `pnpm build && pnpm start` requires the full Next.js build cycle + // (Next.js compile takes 5-15 minutes on the CI runner depending on + // cache state). 120s was too short and caused E2E to time out before + // the server could come up. 25 minutes gives slack for slow builds. + // Locally `pnpm dev` boots in seconds, so the original 2-minute cap + // is preserved. + timeout: process.env.CI ? 1_500_000 : 120_000, }, });