0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 07:53:06 +01:00
nodejs/test/internet/test-https-autoselectfamily-slow-timeout.js
Paolo Insogna fddd3ffa59
net: improve network family autoselection handle handling
PR-URL: https://github.com/nodejs/node/pull/48464
Fixes: https://github.com/npm/cli/issues/6409
Fixes: https://github.com/KararTY/dank-twitch-irc/issues/13
Fixes: https://github.com/nodejs/node/issues/47644
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2023-06-27 09:17:16 +00:00

21 lines
531 B
JavaScript

'use strict';
const common = require('../common');
const { addresses } = require('../common/internet');
if (!common.hasCrypto)
common.skip('missing crypto');
const assert = require('assert');
const { request } = require('https');
request(
`https://${addresses.INET_HOST}/en`,
// Purposely set this to a low value because we want all connection but the last to fail
{ autoSelectFamily: true, autoSelectFamilyAttemptTimeout: 10 },
(res) => {
assert.strictEqual(res.statusCode, 200);
res.resume();
},
).end();