mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
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:
parent
069365c5bd
commit
8b51c1a869
22 changed files with 147 additions and 94 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue