You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: use TcpListener(0) for reliable free-port selection in HTTP test server
Replace the random-port-plus-check approach with TcpListener(0), which
asks the OS to assign a free port. The TOCTOU window (between TcpListener.Stop()
and Kestrel's bind) is microseconds, far more reliable than the previous
approach that randomly selected a port from 10000-65000 and then checked
IPGlobalProperties.GetActiveTcpListeners().
Also removes the Windows-CI skip workaround from testMultipartFormDataBodySize,
since the root cause (flaky port selection) is now fixed.
Also fixes Dispose() to properly await StopAsync instead of fire-and-forget.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments