fix(cli): trim overlong session names to fit unix socket path limit#40898
Conversation
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.
This comment has been minimized.
This comment has been minimized.
makeSocketPath now sanitizes the name, so the browser server's pipe endpoint contains `browser-<guid>` instead of `browser@<guid>`.
Test results for "tests others"2 failed 18 flaky19826 passed, 658 skipped Merge workflow run. |
Test results for "MCP"7116 passed, 1113 skipped Merge workflow run. |
Test results for "tests 1"1 flaky42004 passed, 850 skipped Merge workflow run. |
Test results for "tests 2"2 fatal errors, not part of any test 87 flaky273042 passed, 11578 skipped Merge workflow run. |
Summary
makeSocketPathnow sanitizes the name for fs use and hashes the middle when the full path would overflow macOS' 104-bytesun_pathlimit.PLAYWRIGHT_*socket/registry/daemon env vars to thePWTEST_*prefix used for other internal-only test toggles.Fixes #40878