fix(embedded-e2e): force IPv4 base URL for Playwright CI

`flask run` binds IPv4 only, but Node's DNS resolution for `localhost`
on the GH runner can return `::1` (IPv6) first, surfacing as
`connect ECONNREFUSED ::1:8081` once happy-eyeballs flips after the
first read-reset. The embedded suite is uniquely exposed because it
drives heavy Node-side API calls (CSRF + guest token) where the
regular Playwright suite is browser-driven.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joe Li
2026-05-20 14:30:54 -07:00
parent 0d29075898
commit 87ca59c455

View File

@@ -237,7 +237,12 @@ playwright-run() {
cd "$GITHUB_WORKSPACE"
local flasklog="${HOME}/flask-playwright.log"
local port=8081
PLAYWRIGHT_BASE_URL="http://localhost:${port}"
# Use 127.0.0.1 explicitly: `flask run` binds IPv4 only, and Node's DNS
# resolution for `localhost` can return `::1` first (IPv6), which then
# refuses against the IPv4 listener and surfaces as
# `connect ECONNREFUSED ::1:<port>` in API helpers driven from Node
# (e.g., the embedded test app's exposed token fetcher).
PLAYWRIGHT_BASE_URL="http://127.0.0.1:${port}"
if [ -n "$APP_ROOT" ]; then
export SUPERSET_APP_ROOT=$APP_ROOT
PLAYWRIGHT_BASE_URL=${PLAYWRIGHT_BASE_URL}${APP_ROOT}/