Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ added:
-->

Gets the current default value of the `autoSelectFamilyAttemptTimeout` option of [`socket.connect(options)`][].
The initial default value is `250` or the value specified via the command line
The initial default value is `500` or the value specified via the command line
option `--network-family-autoselection-attempt-timeout`.

* Returns: {number} The current default value of the `autoSelectFamilyAttemptTimeout` option.
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class EnvironmentOptions : public Options {
int64_t heap_snapshot_near_heap_limit = 0;
std::string heap_snapshot_signal;
bool network_family_autoselection = true;
uint64_t network_family_autoselection_attempt_timeout = 250;
uint64_t network_family_autoselection_attempt_timeout = 500;
uint64_t max_http_header_size = 16 * 1024;
bool deprecation = true;
bool force_async_hooks_checks = true;
Expand Down
5 changes: 3 additions & 2 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ function isPi() {
}
}

// When using high concurrency or in the CI we need much more time for each connection attempt
net.setDefaultAutoSelectFamilyAttemptTimeout(platformTimeout(net.getDefaultAutoSelectFamilyAttemptTimeout() * 10));
// When using high concurrency or in the CI we need much more time for each connection attempt.
// Default 500ms becomes 2500ms for tests.
net.setDefaultAutoSelectFamilyAttemptTimeout(platformTimeout(net.getDefaultAutoSelectFamilyAttemptTimeout() * 5));
const defaultAutoSelectFamilyAttemptTimeout = net.getDefaultAutoSelectFamilyAttemptTimeout();

const buildType = process.config.target_defaults ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ const { platformTimeout } = require('../common');
const assert = require('assert');
const { getDefaultAutoSelectFamilyAttemptTimeout } = require('net');

assert.strictEqual(getDefaultAutoSelectFamilyAttemptTimeout(), platformTimeout(123 * 10));
assert.strictEqual(getDefaultAutoSelectFamilyAttemptTimeout(), platformTimeout(123 * 5));
Loading