Skip to content

Commit 3f5dad7

Browse files
Zacharonclaude
andcommitted
fix(web): browser tests no longer pick a port Windows has reserved
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 807319c commit 3f5dad7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/web/vite.config.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,11 @@ const unitTestProject = {
9696
// Vitest's fixed browser API port (63315) collides when two checkouts run
9797
// browser tests at once, and `server.strictPort` above is inherited, so the
9898
// second run fails instead of moving on. Hash the checkout path like
99-
// scripts/dev-runner.ts does, into 61000-64999 (above Linux's ephemeral range).
100-
const browserTestApiPort = 61_000 + ((Hash.string(import.meta.dirname) >>> 0) % 4_000);
99+
// scripts/dev-runner.ts does, into 20000-23999: below the Linux (32768+) and
100+
// Windows/macOS (49152+) ephemeral ranges. Hyper-V and WSL reserve blocks inside
101+
// Windows' range, and binding a reserved port fails with EACCES, which
102+
// strictPort: false does not skip.
103+
const browserTestApiPort = 20_000 + ((Hash.string(import.meta.dirname) >>> 0) % 4_000);
101104

102105
const browserTestProject = {
103106
extends: true,

0 commit comments

Comments
 (0)