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 committed Jul 4, 2016
1 parent b3ec243 commit f47c394
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 @@ -29,15 +29,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 f47c394

Please sign in to comment.