We fix the EADDRINUSE error by adding a module-level _allocatedPorts set in derivePort.ts that tracks every port assigned within the current process. When rm -rf port*.txt clears all cached port files before each test run, both getTestServerPort and getDummyServerPort called getRandomPort() in rapid succession and consistently received the same port (43099), because getRandomPort temporarily binds then immediately releases a port — leaving it free for the very next call. The do/while loop now retries until a port not already in the set is returned, guaranteeing unique ports across all derivePort invocations in the same process.
Failed after TLTanner LinsleyView latest
docs: address agent skill review feedback
78671802a75Open on GitHubThis code change can't be applied
A fix is available, but it can't be applied automatically because the branch is outdated. Please sync the branch, then apply the fix locally below.