From 73897407c75efee1d5eb14181fba052b8e184d9b Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Thu, 11 Jun 2026 15:20:24 -0400 Subject: [PATCH] =?UTF-8?q?fix(08-03):=20harness=20uses=20127.0.0.1=20+=20?= =?UTF-8?q?ipv4first=20=E2=80=94=20Vite=20is=20IPv4-only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit global-setup polls baseURL/health via Node fetch; the runner resolves localhost to ::1 first, but Vite binds IPv4-only (127.0.0.1:5173), so localhost→::1:5173 → ECONNREFUSED → health poll never returns 200. (curl passed for :3000 because curl falls back IPv4↔IPv6 and the API is dual-stack; Node fetch does not.) Proven: [::1]:5173 ECONNREFUSED vs 127.0.0.1:5173 200. Point PLAYWRIGHT_BASE_URL at 127.0.0.1 and add --dns-result-order=ipv4first. No harness files changed. --- .gitea/workflows/ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d1f2429..312c576 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -233,7 +233,14 @@ jobs: - name: Run harness (start API + Playwright iphone + pixel) env: CI: 'true' - PLAYWRIGHT_BASE_URL: http://localhost:5173 + # Use 127.0.0.1 (not localhost): the runner image resolves `localhost` to ::1 first, + # but the Vite dev server binds IPv4-only (127.0.0.1:5173). global-setup.ts uses Node + # fetch (no IPv4 fallback, unlike curl), so localhost→::1:5173 → ECONNREFUSED → its + # /health poll never returns 200. Proven via [::1]:5173 ECONNREFUSED vs 127.0.0.1:5173 200. + # --dns-result-order=ipv4first is defense-in-depth for any remaining localhost hop + # (Vite's /health proxy → localhost:3000; the API is dual-stack so that hop already works). + PLAYWRIGHT_BASE_URL: http://127.0.0.1:5173 + NODE_OPTIONS: '--dns-result-order=ipv4first' DEV_AUTH_BYPASS: 'true' NODE_ENV: development DB_HOST: mariadb