Skip to content

fix(cli): trim overlong session names to fit unix socket path limit#40898

Merged
yury-s merged 3 commits into
microsoft:mainfrom
yury-s:fix-40878
May 18, 2026
Merged

fix(cli): trim overlong session names to fit unix socket path limit#40898
yury-s merged 3 commits into
microsoft:mainfrom
yury-s:fix-40878

Conversation

@yury-s
Copy link
Copy Markdown
Member

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

Summary

  • makeSocketPath now sanitizes the name for fs use and hashes the middle when the full path would overflow macOS' 104-byte sun_path limit.
  • Drive-by: rename internal PLAYWRIGHT_* socket/registry/daemon env vars to the PWTEST_* prefix used for other internal-only test toggles.

Fixes #40878

yury-s added 2 commits May 18, 2026 10:56
Long session names plus a long os.tmpdir() prefix (e.g. /var/folders/...
on macOS) pushed the cli daemon's unix socket path past sun_path's 104-byte
limit, and listen() failed with EINVAL. makeSocketPath now sanitizes the
name for fs use and hashes the middle when the full path would overflow.

Fixes microsoft#40878
PLAYWRIGHT_SOCKETS_DIR, PLAYWRIGHT_SERVER_REGISTRY, and
PLAYWRIGHT_DAEMON_SESSION_DIR are only consumed internally and set by
test fixtures. The PLAYWRIGHT_ prefix is reserved for public APIs;
switch to the PWTEST_ prefix used for other internal-only toggles.
@github-actions

This comment has been minimized.

@yury-s yury-s added CQ1 and removed CQ1 labels May 18, 2026
makeSocketPath now sanitizes the name, so the browser server's pipe
endpoint contains `browser-<guid>` instead of `browser@<guid>`.
@github-actions
Copy link
Copy Markdown
Contributor

Test results for "tests others"

2 failed
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @frozen-time-library-chromium-linux
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @realtime-time-library-chromium-linux

18 flaky ⚠️ [electron-page] › page/page-localstorage.spec.ts:49 › localStorage.removeItem removes a single item `@electron-ubuntu-latest`
⚠️ [electron-page] › page/page-navigation.spec.ts:28 › should work with cross-process _blank target `@electron-ubuntu-latest`
⚠️ [electron-page] › page/page-navigation.spec.ts:36 › should work with _blank target in form `@electron-ubuntu-latest`
⚠️ [electron-page] › page/page-request-continue.spec.ts:398 › should respect set-cookie in redirect response `@electron-ubuntu-latest`
⚠️ [electron-page] › page/page-route.spec.ts:74 › should not support ? in glob pattern `@electron-ubuntu-latest`
⚠️ [electron-page] › page/page-route.spec.ts:169 › should not override cookie header `@electron-ubuntu-latest`
⚠️ [electron-page] › page/page-localstorage.spec.ts:49 › localStorage.removeItem removes a single item `@electron-macos-latest`
⚠️ [electron-page] › page/page-navigation.spec.ts:28 › should work with cross-process _blank target `@electron-macos-latest`
⚠️ [electron-page] › page/page-navigation.spec.ts:36 › should work with _blank target in form `@electron-macos-latest`
⚠️ [electron-page] › page/page-request-continue.spec.ts:398 › should respect set-cookie in redirect response `@electron-macos-latest`
⚠️ [electron-page] › page/page-route.spec.ts:74 › should not support ? in glob pattern `@electron-macos-latest`
⚠️ [electron-page] › page/page-route.spec.ts:169 › should not override cookie header `@electron-macos-latest`
⚠️ [electron-page] › page/page-localstorage.spec.ts:49 › localStorage.removeItem removes a single item `@electron-windows-latest`
⚠️ [electron-page] › page/page-navigation.spec.ts:28 › should work with cross-process _blank target `@electron-windows-latest`
⚠️ [electron-page] › page/page-navigation.spec.ts:36 › should work with _blank target in form `@electron-windows-latest`
⚠️ [electron-page] › page/page-request-continue.spec.ts:398 › should respect set-cookie in redirect response `@electron-windows-latest`
⚠️ [electron-page] › page/page-route.spec.ts:74 › should not support ? in glob pattern `@electron-windows-latest`
⚠️ [electron-page] › page/page-route.spec.ts:169 › should not override cookie header `@electron-windows-latest`

19826 passed, 658 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

Test results for "MCP"

7116 passed, 1113 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 flaky ⚠️ [chromium-library] › library/popup.spec.ts:261 › should not throw when click closes popup `@chromium-ubuntu-22.04-arm-node20`

42004 passed, 850 skipped


Merge workflow run.

@github-actions
Copy link
Copy Markdown
Contributor

Test results for "tests 2"

2 fatal errors, not part of any test
53 failed
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @msedge-beta-ubuntu-22.04
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-headed-ubuntu-24.04
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @tracing-chromium
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @msedge-ubuntu-22.04
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-macos-26-large
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @msedge-dev-ubuntu-22.04
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-tip-of-tree-macos-15--headed
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-headed-macos-15-xlarge
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chrome-ubuntu-22.04
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-tip-of-tree-macos-15
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-ubuntu-24.04
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @channel-chromium-ubuntu-latest
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @msedge-macos-latest
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @channel-chromium-macos-latest
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-macos-15-large
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-macos-14-xlarge
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-macos-15-xlarge
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @tracing-chromium-tip-of-tree
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-tip-of-tree-headless-shell-ubuntu-22.04
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @msedge-beta-macos-latest
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @msedge-dev-macos-latest
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chrome-beta-ubuntu-22.04
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chrome-beta-macos-latest
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-macos-26-xlarge
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chromium-tip-of-tree-ubuntu-22.04--headed
❌ [chromium-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @chrome-macos-latest
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @firefox-macos-26-xlarge
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @firefox-headed-macos-15-xlarge
❌ [firefox-library] › library/screencast.spec.ts:28 › screencast.start delivers frames via onFrame callback @firefox-headed-macos-15-xlarge
❌ [firefox-library] › library/screencast.spec.ts:55 › onFrame receives viewport size @firefox-headed-macos-15-xlarge
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @firefox-headed-ubuntu-24.04
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @firefox-beta-ubuntu-22.04
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @tracing-firefox
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @firefox-ubuntu-24.04
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @firefox-beta-macos-latest
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @firefox-macos-15-large
❌ [firefox-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @firefox-macos-15-xlarge
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @webkit-macos-26-large
❌ [webkit-library] › library/inspector/cli-codegen-2.spec.ts:105 › cli codegen › should upload a single file @webkit-macos-26-large
❌ [webkit-library] › library/tracing.spec.ts:432 › should produce screencast frames crop @webkit-macos-26-large
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @webkit-headed-ubuntu-24.04
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @webkit-headed-macos-15-xlarge
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @webkit-headed-ubuntu-22.04
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @tracing-webkit
❌ [webkit-library] › library/inspector/cli-codegen-2.spec.ts:105 › cli codegen › should upload a single file @webkit-windows-latest
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @webkit-macos-26-xlarge
❌ [webkit-library] › library/inspector/cli-codegen-2.spec.ts:105 › cli codegen › should upload a single file @webkit-macos-26-xlarge
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @webkit-ubuntu-24.04
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @webkit-macos-15-xlarge
❌ [webkit-library] › library/inspector/cli-codegen-2.spec.ts:105 › cli codegen › should upload a single file @webkit-macos-15-xlarge
❌ [webkit-library] › library/browser-server.spec.ts:28 › should start and stop pipe server @webkit-macos-15-large
❌ [webkit-library] › library/inspector/cli-codegen-2.spec.ts:105 › cli codegen › should upload a single file @webkit-macos-15-large
❌ [android-page] › page/page-localstorage.spec.ts:99 › storage methods are scoped to the current origin

87 flaky ⚠️ [chromium-library] › library/selector-generator.spec.ts:710 › selector generator › should not use icon fonts aria name `@chromium-headed-ubuntu-24.04`
⚠️ [chromium-page] › page/page-mouse.spec.ts:174 › should report correct pointerType property `@chromium-headed-ubuntu-24.04`
⚠️ [chromium-library] › library/inspector/cli-codegen-3.spec.ts:224 › cli codegen › should generate frame locators (4) `@msedge-dev-windows-latest`
⚠️ [chromium-library] › library/inspector/recorder-api.spec.ts:49 › should click `@msedge-dev-windows-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:189 › launchServer › should ignore page.pause when headed `@chromium-macos-26-large`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:141 › launchServer › should be able to reconnect to a browser `@chromium-tip-of-tree-macos-15--headed`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:431 › launchServer › should reject waitForEvent before browser.close finishes `@chromium-tip-of-tree-macos-15--headed`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:632 › launchServer › should properly disconnect when connection closes from the client side `@chromium-tip-of-tree-macos-15--headed`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:1117 › launchServer only › should be able to reconnect to a browser 12 times without warnings `@chromium-tip-of-tree-macos-15--headed`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:431 › launchServer › should reject waitForEvent before browser.close finishes `@chromium-headed-macos-15-xlarge`
⚠️ [chromium-page] › page/page-fill.spec.ts:29 › should fill input `@chromium-headed-macos-15-xlarge`
⚠️ [chromium-library] › library/video.spec.ts:719 › screencast › should work with video+trace `@chromium-tip-of-tree-windows-latest`
⚠️ [chromium-library] › library/popup.spec.ts:261 › should not throw when click closes popup `@chrome-ubuntu-22.04`
⚠️ [chromium-library] › library/inspector/recorder-api.spec.ts:120 › should type `@channel-chromium-ubuntu-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:141 › launchServer › should be able to reconnect to a browser `@channel-chromium-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:1117 › launchServer only › should be able to reconnect to a browser 12 times without warnings `@channel-chromium-macos-latest`
⚠️ [chromium-library] › library/video.spec.ts:275 › screencast › should capture navigation `@channel-chromium-macos-latest`
⚠️ [chromium-page] › page/locator-frame.spec.ts:272 › should work with COEP/COOP/CORP isolated iframe `@channel-chromium-macos-latest`
⚠️ [chromium-library] › library/chromium/extensions.spec.ts:105 › MV3 › should give access to the service worker when recording video `@msedge-windows-latest`
⚠️ [chromium-library] › library/video.spec.ts:337 › screencast › should work for popups `@chromium-windows-latest`
⚠️ [chromium-library] › library/video.spec.ts:647 › screencast › should capture full viewport `@chromium-macos-15-xlarge`
⚠️ [chromium-library] › library/browsercontext-user-agent.spec.ts:110 › should work for navigator.userAgentData and sec-ch-ua headers `@msedge-beta-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:141 › launchServer › should be able to reconnect to a browser `@msedge-beta-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:189 › launchServer › should ignore page.pause when headed `@msedge-beta-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:1117 › launchServer only › should be able to reconnect to a browser 12 times without warnings `@msedge-beta-macos-latest`
⚠️ [chromium-library] › library/browsercontext-user-agent.spec.ts:110 › should work for navigator.userAgentData and sec-ch-ua headers `@msedge-dev-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:141 › launchServer › should be able to reconnect to a browser `@msedge-dev-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:431 › launchServer › should reject waitForEvent before browser.close finishes `@msedge-dev-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:686 › launchServer › should filter launch options `@msedge-dev-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:1117 › launchServer only › should be able to reconnect to a browser 12 times without warnings `@msedge-dev-macos-latest`
⚠️ [chromium-library] › library/beforeunload.spec.ts:130 › should support dismissing the dialog multiple times `@chrome-beta-ubuntu-22.04`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:189 › launchServer › should ignore page.pause when headed `@chrome-beta-macos-latest`
⚠️ [chromium-library] › library/browsertype-connect.spec.ts:632 › launchServer › should properly disconnect when connection closes from the client side `@chrome-beta-macos-latest`
⚠️ [chromium-library] › library/video.spec.ts:647 › screencast › should capture full viewport `@chromium-macos-26-xlarge`
⚠️ [chromium-library] › library/video.spec.ts:133 › screencast › should continue recording main page after popup closes `@chrome-macos-latest`
⚠️ [firefox-library] › library/defaultbrowsercontext-1.spec.ts:89 › should support viewport option `@firefox-macos-26-xlarge`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-macos-26-xlarge`
⚠️ [firefox-library] › library/page-close.spec.ts:152 › should not treat navigations as new popups `@firefox-headed-macos-15-xlarge`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-headed-macos-15-xlarge`
⚠️ [firefox-library] › library/browsercontext-basic.spec.ts:36 › should be able to click across browser contexts `@firefox-headed-ubuntu-24.04`
⚠️ [firefox-page] › page/page-request-gc.spec.ts:19 › should work `@firefox-headed-ubuntu-24.04`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-beta-ubuntu-22.04`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@tracing-firefox`
⚠️ [firefox-page] › page/page-event-request.spec.ts:385 › should return last requests `@firefox-beta-windows-latest`
⚠️ [firefox-library] › library/browsercontext-events.spec.ts:30 › console event should work with element handles `@firefox-headed-windows-latest`
⚠️ [firefox-library] › library/browsercontext-viewport.spec.ts:29 › should set the proper viewport size `@firefox-headed-windows-latest`
⚠️ [firefox-library] › library/browsercontext-viewport.spec.ts:35 › should return correct outerWidth and outerHeight `@firefox-headed-windows-latest`
⚠️ [firefox-library] › library/browsercontext-viewport.spec.ts:178 › should be able to get correct orientation angle on non-mobile devices `@firefox-headed-windows-latest`
⚠️ [firefox-library] › library/screencast.spec.ts:78 › start throws if screencast is already started `@firefox-headed-windows-latest`
⚠️ [firefox-library] › library/trace-viewer.spec.ts:553 › should syntax highlight body `@firefox-headed-windows-latest`
⚠️ [firefox-library] › library/trace-viewer.spec.ts:639 › should show snapshot URL and copy button `@firefox-headed-windows-latest`
⚠️ [firefox-library] › library/video.spec.ts:181 › screencast › should delete video `@firefox-headed-windows-latest`
⚠️ [firefox-page] › page/page-click-scroll.spec.ts:19 › should not hit scroll bar `@firefox-headed-windows-latest`
⚠️ [firefox-page] › page/page-keyboard.spec.ts:614 › should type repeatedly in input in shadow dom `@firefox-beta-macos-latest`
⚠️ [firefox-library] › library/screenshot.spec.ts:280 › element screenshot › should restore default viewport after fullPage screenshot `@firefox-macos-15-xlarge`
⚠️ [webkit-library] › library/browsertype-connect.spec.ts:739 › launchServer › should upload large file `@webkit-macos-26-large`
⚠️ [webkit-library] › library/browsertype-connect.spec.ts:792 › run-server › should upload a folder `@webkit-macos-26-large`
⚠️ [webkit-library] › library/inspector/pause.spec.ts:537 › pause › should highlight locators with custom testId `@webkit-macos-26-large`
⚠️ [webkit-library] › library/role-utils.spec.ts:38 › wpt accname #3 `@webkit-macos-26-large`
⚠️ [webkit-library] › library/route-web-socket.spec.ts:169 › no-match › should work with client-side close `@webkit-macos-26-large`
⚠️ [webkit-library] › library/screencast-actions.spec.ts:151 › should stop showing actions after dispose `@webkit-macos-26-large`
⚠️ [webkit-library] › library/selector-generator.spec.ts:46 › selector generator › should prefer button over inner span `@webkit-macos-26-large`
⚠️ [webkit-library] › library/trace-viewer.spec.ts:1614 › should open snapshot in new browser context `@webkit-macos-26-large`
⚠️ [webkit-library] › library/tracing.spec.ts:432 › should produce screencast frames scale `@webkit-macos-26-large`
⚠️ [webkit-page] › page/page-click.spec.ts:895 › should not throw protocol error when navigating during the click `@webkit-macos-26-large`
⚠️ [webkit-page] › page/page-evaluate.spec.ts:568 › should transfer 100Mb of data from page to node.js `@webkit-macos-26-large`
⚠️ [webkit-page] › page/page-filechooser.spec.ts:81 › should emit event for iframe `@webkit-macos-26-large`
⚠️ [webkit-page] › page/page-fill.spec.ts:108 › input event.composed should be true and cross shadow dom boundary - range `@webkit-macos-26-large`
⚠️ [webkit-page] › page/page-goto.spec.ts:49 › should use http for no protocol `@webkit-macos-26-large`
⚠️ [webkit-page] › page/page-request-continue.spec.ts:251 › post data › should amend binary post data `@webkit-macos-26-large`
⚠️ [webkit-page] › page/page-request-fallback.spec.ts:239 › post data › should amend binary post data `@webkit-macos-26-large`
⚠️ [webkit-page] › page/page-request-fallback.spec.ts:263 › post data › should amend json post data `@webkit-macos-26-large`
⚠️ [webkit-library] › library/video.spec.ts:275 › screencast › should capture navigation `@webkit-headed-windows-latest`
⚠️ [webkit-library] › library/browsercontext-basic.spec.ts:72 › should be able to hover across browser contexts in parallel `@webkit-headed-ubuntu-22.04`
⚠️ [webkit-page] › page/page-set-input-files.spec.ts:38 › should upload a folder `@webkit-headed-ubuntu-22.04`
⚠️ [webkit-library] › library/har.spec.ts:427 › should return receive time `@webkit-windows-latest`
⚠️ [webkit-library] › library/browsertype-connect.spec.ts:792 › launchServer › should upload a folder `@webkit-macos-15-large`
⚠️ [webkit-library] › library/inspector/cli-codegen-aria.spec.ts:87 › should update aria snapshot highlight `@webkit-macos-15-large`
⚠️ [webkit-library] › library/trace-viewer.spec.ts:171 › should open simple trace viewer `@webkit-macos-15-large`
⚠️ [webkit-library] › library/tracing.spec.ts:432 › should produce screencast frames fit `@webkit-macos-15-large`
⚠️ [webkit-library] › library/video.spec.ts:275 › screencast › should capture navigation `@webkit-macos-15-large`
⚠️ [android-page] › page/page-goto.spec.ts:453 › should disable timeout when its set to 0
⚠️ [android-page] › page/page-localstorage.spec.ts:49 › localStorage.removeItem removes a single item
⚠️ [android-page] › page/page-request-continue.spec.ts:162 › should override method along with url
⚠️ [android-page] › page/page-request-fallback.spec.ts:123 › should amend HTTP headers
⚠️ [android-page] › page/page-request-fulfill.spec.ts:195 › should not modify the headers sent to the server
⚠️ [android-page] › page/page-route.spec.ts:317 › should not throw if request was cancelled by the page

273042 passed, 11578 skipped


Merge workflow run.

@yury-s yury-s merged commit 0523914 into microsoft:main May 18, 2026
46 checks passed
@yury-s yury-s deleted the fix-40878 branch May 18, 2026 23:51
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-cli open fails with EINVAL when session name is long on macOS due to unix socket path length

2 participants