Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v18.x backport] backport 49574 and 50240 to v18.x #52384

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions test/sequential/test-http-regr-gh-2928.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const httpCommon = require('_http_common');
const { HTTPParser } = require('_http_common');
const net = require('net');

httpCommon.parsers.max = 50;

const COUNT = httpCommon.parsers.max + 1;

const parsers = new Array(COUNT);
Expand All @@ -25,7 +27,7 @@ function execAndClose() {
const parser = parsers.pop();
parser.initialize(HTTPParser.RESPONSE, {});

const socket = net.connect(common.PORT);
const socket = net.connect(common.PORT, common.localhostIPv4);
socket.on('error', (e) => {
// If SmartOS and ECONNREFUSED, then retry. See
// https://github.com/nodejs/node/issues/2663.
Expand Down Expand Up @@ -57,7 +59,7 @@ const server = net.createServer(function(c) {
c.end('HTTP/1.1 200 OK\r\n\r\n', function() {
c.destroySoon();
});
}).listen(common.PORT, execAndClose);
}).listen(common.PORT, common.localhostIPv4, execAndClose);

process.on('exit', function() {
assert.strictEqual(gotResponses, COUNT);
Expand Down
Loading