net: enable autoSelectFamily by default

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/46790
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
This commit is contained in:
Paolo Insogna 2023-02-23 10:55:04 +01:00 committed by Rich Trott
parent 069365c5bd
commit 8b51c1a869
22 changed files with 147 additions and 94 deletions

View file

@ -26,6 +26,7 @@ const process = global.process; // Some tests tamper with the process global.
const assert = require('assert');
const { exec, execSync, spawn, spawnSync } = require('child_process');
const fs = require('fs');
const net = require('net');
// Do not require 'os' until needed so that test-os-checked-function can
// monkey patch it. If 'os' is required here, that test will fail.
const path = require('path');
@ -137,6 +138,14 @@ const isPi = (() => {
const isDumbTerminal = process.env.TERM === 'dumb';
// When using high concurrency or in the CI we need much more time for each connection attempt
const defaultAutoSelectFamilyAttemptTimeout = platformTimeout(2500);
// Since this is also used by tools outside of the test suite,
// make sure setDefaultAutoSelectFamilyAttemptTimeout
if (typeof net.setDefaultAutoSelectFamilyAttemptTimeout === 'function') {
net.setDefaultAutoSelectFamilyAttemptTimeout(platformTimeout(defaultAutoSelectFamilyAttemptTimeout));
}
const buildType = process.config.target_defaults ?
process.config.target_defaults.default_configuration :
'Release';
@ -886,6 +895,7 @@ const common = {
canCreateSymLink,
childShouldThrowAndAbort,
createZeroFilledFile,
defaultAutoSelectFamilyAttemptTimeout,
expectsError,
expectWarning,
gcUntil,