From e9397d67a3fb6abfe59dedf313ad58859fc1740b Mon Sep 17 00:00:00 2001 From: Andreas Madsen Date: Sun, 14 Jan 2018 11:09:24 +0100 Subject: [PATCH] async_hooks,test: only use IPv6 in http test If IPv6 is not supported on a machine, the IPv6 handle will first be created, this will then fail and default to an IPv4 handle. This causes the graph to change, as there now is an extra handle. Backport-PR-URL: https://github.com/nodejs/node/pull/18474 PR-URL: https://github.com/nodejs/node/pull/18143 Fixes: https://github.com/nodejs/node/issues/18003 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Anatoli Papirovski Reviewed-By: James M Snell --- test/async-hooks/test-graph.http.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/async-hooks/test-graph.http.js b/test/async-hooks/test-graph.http.js index 5c0c99f408c824..eea72ca3bac72c 100644 --- a/test/async-hooks/test-graph.http.js +++ b/test/async-hooks/test-graph.http.js @@ -1,6 +1,9 @@ 'use strict'; const common = require('../common'); +if (!common.hasIPv6) + common.skip('IPv6 support required'); + const initHooks = require('./init-hooks'); const verifyGraph = require('./verify-graph'); const http = require('http'); @@ -13,7 +16,11 @@ const server = http.createServer(common.mustCall(function(req, res) { this.close(common.mustCall()); })); server.listen(0, common.mustCall(function() { - http.get(`http://127.0.0.1:${server.address().port}`, common.mustCall()); + http.get({ + host: '::1', + family: 6, + port: server.address().port + }, common.mustCall()); })); process.on('exit', function() {