diff --git a/test/sequential/test-http-regr-gh-2928.js b/test/sequential/test-http-regr-gh-2928.js index 149aaeb6e6e420..25476e0453c53b 100644 --- a/test/sequential/test-http-regr-gh-2928.js +++ b/test/sequential/test-http-regr-gh-2928.js @@ -25,7 +25,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. @@ -57,7 +57,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);