fix: use listen(0) for OS auto-port-allocation instead of getPort#1855
fix: use listen(0) for OS auto-port-allocation instead of getPort#1855inkpark wants to merge 3 commits intomicrosoft:mainfrom
Conversation
…-selection
In WSL/Windows port environments, the two-step pattern of
reserving a
port with getPort() then rebinding to it caused massive EADDRINUSE
failures (~96 out of 100 attempts). Replacing with
server.listen(0)
lets the OS auto-assign a free port in a single step, achieving 0
failures in the same environment.
Fixes microsoft#1854
@microsoft-github-policy-service agree |
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT license. | ||
|
|
||
| import getPort from 'get-port'; |
There was a problem hiding this comment.
Can you remove get-port from dependencies then?
There was a problem hiding this comment.
Removed the unused get-port dependency from package.json and package-lock.json, and cleaned up the corresponding entry in ThirdPartyNotices.txt. There are no remaining get-port usages in the repo.
fix: use listen(0) for OS auto-port-allocation instead of getPort pre-selection
In WSL/Windows port environments, the two-step pattern of reserving a
port with getPort() then rebinding to it caused massive EADDRINUSE
failures (~96 out of 100 attempts). Replacing with
server.listen(0)
lets the OS auto-assign a free port in a single step, achieving 0
failures in the same environment.
Fixes #1854