Skip to content

test(mcp): hash outputDir into PLAYWRIGHT_SOCKETS_DIR#40636

Merged
Skn0tt merged 1 commit intomainfrom
copilot/update-test-output-path-hashing
May 6, 2026
Merged

test(mcp): hash outputDir into PLAYWRIGHT_SOCKETS_DIR#40636
Skn0tt merged 1 commit intomainfrom
copilot/update-test-output-path-hashing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

Concurrent test runs from two Playwright checkouts share PLAYWRIGHT_SOCKETS_DIR (currently <tmpdir>/ds<workerIndex>) and collide. Within a single checkout we want collisions preserved to surface races and cleanup bugs.

Change

  • In tests/mcp/cli-fixtures.ts, append a short SHA1 hash of test.info().outputDir to the socket dir name.
  • Hash truncated to 8 hex chars to stay well under UNIX domain socket path length limits (~104 bytes on macOS).
PLAYWRIGHT_SOCKETS_DIR: path.join(
  os.tmpdir(),
  'ds' + String(test.info().workerIndex) + '-' +
    crypto.createHash('sha1').update(test.info().outputDir).digest('hex').slice(0, 8),
),

outputDir is stable for a given test within a checkout (collisions retained) and differs across checkouts (isolation achieved).

@Skn0tt Skn0tt requested a review from dgozman May 5, 2026 13:26
@Skn0tt Skn0tt marked this pull request as ready for review May 5, 2026 13:26
@Skn0tt Skn0tt merged commit 89e46b8 into main May 6, 2026
14 of 16 checks passed
@Skn0tt Skn0tt deleted the copilot/update-test-output-path-hashing branch May 6, 2026 06:34
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.

3 participants