fix(08-03): harness uses 127.0.0.1 + ipv4first — Vite is IPv4-only
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user