From 0e6f4f79e5101f5ff5ef8d078e5cc286d9273c55 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 179b3ae3c2e241..d6de00b3a1eb25 100644 --- a/test/sequential/test-net-GH-5504.js +++ b/test/sequential/test-net-GH-5504.js @@ -30,7 +30,7 @@ function server() { console.error('_socketEnd'); }); socket.write(content); - }).listen(common.PORT, function() { + }).listen(common.PORT, common.localhostIPv4, function() { console.log('listening'); }); } @@ -38,7 +38,7 @@ function server() { function client() { var net = require('net'); var client = net.connect({ - host: 'localhost', + host: common.localhostIPv4, port: common.PORT }, function() { client.destroy();