Skip to content

Commit

Permalink
test: deflake test-http-regr-nodejsgh-2928
Browse files Browse the repository at this point in the history
Hard code the value of the host parameter to `common.localhostIPv4` in
`server.listen()` and `net.connect()`. This

1. ensures that the client `socket._handle` is not reinitialized during
   connection due to the family autodetection algorithm, preventing
   `parser.consume()` from being called with an invalid `socket._handle`
   parameter.
2. works around an issue in the FreeBSD 12 machine where the stress test
   is run where some sockets get stuck after connection.

Closes: nodejs#49565
Fixes: nodejs#49564
  • Loading branch information
lpinca committed Sep 10, 2023
1 parent 0a2ab4c commit a737491
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/sequential/test-http-regr-gh-2928.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ function execAndClose() {
throw e;
});

parser.consume(socket._handle);
socket.on('connect', function() {
parser.consume(socket._handle);
});

parser.onIncoming = function onIncoming() {
process.stdout.write('+');
Expand Down

0 comments on commit a737491

Please sign in to comment.