fix: register connect listener before initiating requests in close-and-destroy test by mcollina · Pull Request #5272 · nodejs/undici (original) (raw)
…d-destroy test
The 'close should still reconnect' test registered the 'connect' listener after makeRequest() was called. On fast connections (like localhost on Windows), the connection could complete before the listener was registered, causing the socket to never be destroyed and making the test flaky.
Move the client.once('connect', ...) registration before makeRequest() to ensure the listener is always in place when the connection is established.
approved these changes May 11, 2026
mcollina deleted the fix-5265-close-and-destroy branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})