()
| 16 | let proxyHandle: ProxyHandle | undefined; |
| 17 | |
| 18 | function getTestPort(): number { |
| 19 | // Keep worker 1 on the historical default (8402), then offset others. |
| 20 | const workerRaw = process.env.VITEST_POOL_ID ?? process.env.VITEST_WORKER_ID ?? "1"; |
| 21 | const workerId = Number.parseInt(workerRaw, 10); |
| 22 | if (Number.isInteger(workerId) && workerId >= 1) { |
| 23 | return 8401 + workerId; |
| 24 | } |
| 25 | return 8402; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Start the test proxy on a worker-scoped port. |