From f47c394d75089dcb6f936fa501f6fe5820e38eab Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 2 Jul 2016 10:08:26 +0200 Subject: [PATCH] test: listen on and connect to 127.0.0.1 Avoid transient DNS issues in test sequential/test-net-GH-5504 by using the IP address instead of the 'localhost' host name. Fixes: https://github.com/nodejs/node/issues/6611 PR-URL: https://github.com/nodejs/node/pull/7524 Reviewed-By: Brian White Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Santiago Gimeno --- test/sequential/test-net-GH-5504.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js index 0121f3bf25d1d7..e760c26c2944e0 100644 --- a/test/sequential/test-net-GH-5504.js +++ b/test/sequential/test-net-GH-5504.js @@ -29,7 +29,7 @@ function server() { console.error('_socketEnd'); }); socket.write(content); - }).listen(common.PORT, function() { + }).listen(common.PORT, common.localhostIPv4, function() { console.log('listening'); }); } @@ -37,7 +37,7 @@ function server() { function client() { var net = require('net'); var client = net.connect({ - host: 'localhost', + host: common.localhostIPv4, port: common.PORT }, function() { client.destroy();