Skip to content

Fix Windows E2E test failures: bind native PHP site proxy to 127.0.0.1#4067

Open
gavande1 wants to merge 1 commit into
fix-windows-e2e-daemon-leakfrom
fix-windows-e2e-ipv6-loopback
Open

Fix Windows E2E test failures: bind native PHP site proxy to 127.0.0.1#4067
gavande1 wants to merge 1 commit into
fix-windows-e2e-daemon-leakfrom
fix-windows-e2e-ipv6-loopback

Conversation

@gavande1

@gavande1 gavande1 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

AI analyzed the Buildkite logs from the first post-hang-fix Windows runs (builds #18670/#18671), correlated the 24 identical ERR_CONNECTION_REFUSED test failures with the proxy's listen( port, 'localhost' ) call, and proposed the reproduction script that confirmed the IPv6-only bind on a Windows VM. The fix and commit were reviewed and tested by a human on that VM.

Proposed Changes

After #4041 stopped the 3-hour hang, Windows E2E runs finished but still failed 24 tests, all the same way: page.goto( http://localhost:<port> ) gets ERR_CONNECTION_REFUSED, so every "open a site" assertion sees a blank page.

The cause is in the native PHP runtime's HTTP proxy (apps/cli/php-server-child.ts): it listens with hostname 'localhost', which Node resolves to ::1 on Windows and binds IPv6-only. Reproduced on a Windows VM: a server bound this way accepts connections on ::1 but refuses 127.0.0.1. On the CI Windows agents, Chromium resolves localhost to 127.0.0.1, so every navigation to a running site is refused — deterministically, which is why all 24 failures also failed their retry. (Linux E2E dodged the same class of problem with a --host-resolver-rules=MAP localhost 127.0.0.1 browser flag; Windows has no such flag.)

The fix binds the proxy explicitly to 127.0.0.1, which is always reachable — clients resolving localhost to ::1 fall back to IPv4. The internal admin-credentials and readiness requests now also target 127.0.0.1 so they check the address the proxy actually listens on, instead of passing via ::1 while browsers get refused.

Testing Instructions

  • CI: The E2E Tests on windows-x64 job (enabled on the base branch) should no longer show net::ERR_CONNECTION_REFUSED failures; the ~24 "open a site" tests should pass and the run should complete in roughly the pre-regression time (~25-30 min) without retry inflation.
  • Local (Windows): npm run e2e -- site-creation — previously failed at the site-page assertion, passes with this change.
  • Regression check (macOS/Linux): sites still start and load normally; 127.0.0.1 is valid loopback on all supported platforms.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

On Windows, Node resolves 'localhost' to ::1 and binds the site proxy
IPv6-only. Any client that reaches the IPv4 loopback — and CI Windows
agents whose ::1 loopback is unusable — get ECONNREFUSED, so the site
page never loads (every 'open a site' E2E test fails with a blank page).
127.0.0.1 is always available and clients loading http://localhost fall
back to it. Also point the internal admin-credentials and readiness
requests at 127.0.0.1 so they match the new bind address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant