Skip to content

Commit cc7e20e

Browse files
AndreasMadsengibfahn
authored andcommitted
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. PR-URL: nodejs#18143 Backport-PR-URL: nodejs#18179 Fixes: nodejs#18003 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 5dba883 commit cc7e20e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/async-hooks/test-graph.http.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
'use strict';
22

33
const common = require('../common');
4+
if (!common.hasIPv6)
5+
common.skip('IPv6 support required');
6+
47
const initHooks = require('./init-hooks');
58
const verifyGraph = require('./verify-graph');
69
const http = require('http');
@@ -13,7 +16,11 @@ const server = http.createServer(common.mustCall(function(req, res) {
1316
this.close(common.mustCall());
1417
}));
1518
server.listen(0, common.mustCall(function() {
16-
http.get(`http://127.0.0.1:${server.address().port}`, common.mustCall());
19+
http.get({
20+
host: '::1',
21+
family: 6,
22+
port: server.address().port
23+
}, common.mustCall());
1724
}));
1825

1926
process.on('exit', function() {

0 commit comments

Comments
 (0)