fix(08-03): harness uses 127.0.0.1 + ipv4first — Vite is IPv4-only
CI / fast-checks (pull_request) Successful in 50s
CI / api (pull_request) Successful in 56s
CI / harness (pull_request) Failing after 1m49s

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.
This commit is contained in:
Lucas Berger
2026-06-11 15:20:24 -04:00
parent 53a989c3fb
commit 73897407c7
+8 -1
View File
@@ -233,7 +233,14 @@ jobs:
- name: Run harness (start API + Playwright iphone + pixel) - name: Run harness (start API + Playwright iphone + pixel)
env: env:
CI: 'true' 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' DEV_AUTH_BYPASS: 'true'
NODE_ENV: development NODE_ENV: development
DB_HOST: mariadb DB_HOST: mariadb