From 4033dabf00b95bba8dc6c3eb0118f25450e45ed6 Mon Sep 17 00:00:00 2001 From: Gireesh Punathil Date: Mon, 25 Jul 2016 07:53:33 -0400 Subject: [PATCH] test: avoid IPv6 hostname conflict in windows The test case test/gc/test-net-timeout.js fails in Windows due to the mixed-use of unspecified and loopback addresses. This is not a problem in most platforms but fails in Windows. A detailed test report describes the platform differences (https://github.com/nodejs/node/issues/7728) and the general direction suggested is to fix the tests according to their platform specific requirements --- test/gc/test-net-timeout.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/gc/test-net-timeout.js b/test/gc/test-net-timeout.js index 5618cab5b39d73..bd351eba9bb9c3 100644 --- a/test/gc/test-net-timeout.js +++ b/test/gc/test-net-timeout.js @@ -36,7 +36,12 @@ function getall() { if (count >= todo) return; - const req = net.connect(server.address().port, server.address().address); + if(server.address().family === 'IPv4') { + var req = net.connect(server.address().port, '127.0.0.1'); + } + else { + var req = net.connect(server.address().port, '::1'); + } req.resume(); req.setTimeout(10, function() { req.destroy();