Skip to content

fix(test-server): bind to 127.0.0.1 instead of 'localhost'#40295

Open
yury-s wants to merge 1 commit intomicrosoft:mainfrom
yury-s:fix-40226
Open

fix(test-server): bind to 127.0.0.1 instead of 'localhost'#40295
yury-s wants to merge 1 commit intomicrosoft:mainfrom
yury-s:fix-40226

Conversation

@yury-s
Copy link
Copy Markdown
Member

@yury-s yury-s commented Apr 18, 2026

Summary

  • Default test-server --host and startHttpServer to 127.0.0.1 instead of localhost.
  • localhost resolves to ::1 first on many dual-stack setups; the Windows 11 25H2 update broke IPv6 loopback outright, leaving clients with connect ETIMEDOUT ::1:<port> (widely reported for the VSCode extension).
  • IPv4 loopback is reachable on all affected machines. Users who actually want IPv6 can still pass --host ::1 explicitly.

Fixes #40226

'localhost' resolution is ambiguous on dual-stack systems and prefers
'::1' first on many environments. The IPv6 loopback has proven
unreliable (recent Windows 25H2 update broke it outright for the
Playwright VS Code extension), leaving clients with
connect ETIMEDOUT ::1:<port>.

Default both the test-server CLI --host option and the internal
startHttpServer helper to IPv4 loopback, so clients can always connect.

Fixes: microsoft#40226
Copy link
Copy Markdown
Member

@pavelfeldman pavelfeldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stale defender rules problem

@github-actions
Copy link
Copy Markdown
Contributor

Test results for "MCP"

26 failed
❌ [chrome] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-ubuntu-latest
❌ [chromium] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-ubuntu-latest
❌ [chrome] › mcp/cli-devtools.spec.ts:184 › pick activates dashboard session @mcp-windows-latest
❌ [chrome] › mcp/dashboard.spec.ts:135 › should capture annotations via show --annotate @mcp-windows-latest
❌ [chrome] › mcp/dashboard.spec.ts:156 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest
❌ [chrome] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-windows-latest
❌ [chromium] › mcp/cli-devtools.spec.ts:184 › pick activates dashboard session @mcp-windows-latest
❌ [chromium] › mcp/dashboard.spec.ts:135 › should capture annotations via show --annotate @mcp-windows-latest
❌ [chromium] › mcp/dashboard.spec.ts:156 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest
❌ [chromium] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-windows-latest
❌ [chrome] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-macos-latest
❌ [chromium] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-macos-latest
❌ [firefox] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-ubuntu-latest
❌ [webkit] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-ubuntu-latest
❌ [firefox] › mcp/dashboard.spec.ts:135 › should capture annotations via show --annotate @mcp-windows-latest
❌ [firefox] › mcp/dashboard.spec.ts:156 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest
❌ [firefox] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-windows-latest
❌ [webkit] › mcp/dashboard.spec.ts:135 › should capture annotations via show --annotate @mcp-windows-latest
❌ [webkit] › mcp/dashboard.spec.ts:156 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest
❌ [webkit] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-windows-latest
❌ [msedge] › mcp/cli-devtools.spec.ts:184 › pick activates dashboard session @mcp-windows-latest
❌ [msedge] › mcp/dashboard.spec.ts:135 › should capture annotations via show --annotate @mcp-windows-latest
❌ [msedge] › mcp/dashboard.spec.ts:156 › should start dashboard and annotate when no dashboard is running @mcp-windows-latest
❌ [msedge] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-windows-latest
❌ [firefox] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-macos-latest
❌ [webkit] › mcp/http.spec.ts:347 › should not allow rebinding to localhost @mcp-macos-latest

6395 passed, 976 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [installation tests] › playwright-electron-should-work.spec.ts:21 › electron should work @package-installations-windows-latest

7 flaky ⚠️ [installation tests] › playwright-electron-should-work.spec.ts:31 › electron should work with special characters in path `@package-installations-windows-latest`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:647 › screencast › should capture full viewport `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:275 › screencast › should capture navigation `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1080 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-test-output.spec.ts:118 › should collapse repeated console messages for test `@ubuntu-latest-node22`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:700 › should indicate current test status `@windows-latest-node20`

39248 passed, 847 skipped


Merge workflow run.

@lucsoft
Copy link
Copy Markdown

lucsoft commented Apr 20, 2026

I don't know how to address this anywhere, but in an on going effort to replace ipv4 this seems like a step backwards?

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.

[Bug]: PlayWright extension for VSCode showing 'no tests have been found'

3 participants