Skip to content
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