Skip to content

Commit a737491

Browse files
committed
test: deflake test-http-regr-nodejsgh-2928
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
1 parent 0a2ab4c commit a737491

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/sequential/test-http-regr-gh-2928.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ function execAndClose() {
3939
throw e;
4040
});
4141

42-
parser.consume(socket._handle);
42+
socket.on('connect', function() {
43+
parser.consume(socket._handle);
44+
});
4345

4446
parser.onIncoming = function onIncoming() {
4547
process.stdout.write('+');

0 commit comments

Comments
 (0)