Skip to content

Commit 89e46b8

Browse files
CopilotSkn0tt
andauthored
test(mcp): hash outputDir into PLAYWRIGHT_SOCKETS_DIR (#40636)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Skn0tt <14912729+Skn0tt@users.noreply.github.com>
1 parent 9eeb4cc commit 89e46b8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/mcp/cli-fixtures.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
import crypto from 'crypto';
1718
import fs from 'fs';
1819
import os from 'os';
1920
import path from 'path';
@@ -118,7 +119,11 @@ function cliEnv() {
118119
PLAYWRIGHT_SERVER_REGISTRY: test.info().outputPath('registry'),
119120
PWTEST_DASHBOARD_SETTINGS_FILE: test.info().outputPath('dashboard.settings.json'),
120121
PLAYWRIGHT_DAEMON_SESSION_DIR: test.info().outputPath('daemon'),
121-
PLAYWRIGHT_SOCKETS_DIR: path.join(os.tmpdir(), 'ds' + String(test.info().workerIndex)),
122+
// Include a short hash of outputDir so that concurrent runs from different
123+
// checkouts use different socket directories, while runs within the same
124+
// checkout share them (which helps surface race conditions and cleanup
125+
// issues). The hash is kept short to stay clear of socket path length limits.
126+
PLAYWRIGHT_SOCKETS_DIR: path.join(os.tmpdir(), 'ds' + String(test.info().workerIndex) + '-' + crypto.createHash('sha1').update(test.info().outputDir).digest('hex').slice(0, 8)),
122127
PWTEST_CLI_CHANNEL_SCAN_DISABLED_FOR_TEST: '1',
123128
};
124129
}

0 commit comments

Comments
 (0)