Skip to content

Commit

Permalink
test: listen on and connect to 127.0.0.1
Browse files Browse the repository at this point in the history
Avoid transient DNS issues in test sequential/test-net-GH-5504 by using
the IP address instead of the 'localhost' host name.

Fixes: #6611
PR-URL: #7524
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
  • Loading branch information
bnoordhuis authored and Myles Borins committed Jul 14, 2016
1 parent e4007cb commit cd12cfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/sequential/test-net-GH-5504.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ function server() {
console.error('_socketEnd');
});
socket.write(content);
}).listen(common.PORT, function() {
}).listen(common.PORT, common.localhostIPv4, function() {
console.log('listening');
});
}

function client() {
var net = require('net');
var client = net.connect({
host: 'localhost',
host: common.localhostIPv4,
port: common.PORT
}, function() {
client.destroy();
Expand Down

0 comments on commit cd12cfd

Please sign in to comment.