Skip to content

Commit c132e9c

Browse files
bnoordhuisFishrock123
authored andcommitted
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: #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>
1 parent 6da49ac commit c132e9c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/sequential/test-net-GH-5504.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ function server() {
2929
console.error('_socketEnd');
3030
});
3131
socket.write(content);
32-
}).listen(common.PORT, function() {
32+
}).listen(common.PORT, common.localhostIPv4, function() {
3333
console.log('listening');
3434
});
3535
}
3636

3737
function client() {
3838
var net = require('net');
3939
var client = net.connect({
40-
host: 'localhost',
40+
host: common.localhostIPv4,
4141
port: common.PORT
4242
}, function() {
4343
client.destroy();

0 commit comments

Comments
 (0)