test: remove unnecessary syscall to cpuinfo

PR-URL: https://github.com/nodejs/node/pull/56968
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Yagiz Nizipli 2025-02-10 17:17:47 -05:00 committed by GitHub
parent 5d7091f1bc
commit f9ea8d6dff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 14 additions and 14 deletions

View file

@ -124,7 +124,7 @@ const isMacOS = process.platform === 'darwin';
const isASan = process.config.variables.asan === 1;
const isRiscv64 = process.arch === 'riscv64';
const isDebug = process.features.debug;
const isPi = (() => {
function isPi() {
try {
// Normal Raspberry Pi detection is to find the `Raspberry Pi` string in
// the contents of `/sys/firmware/devicetree/base/model` but that doesn't
@ -136,7 +136,7 @@ const isPi = (() => {
} catch {
return false;
}
})();
}
// When using high concurrency or in the CI we need much more time for each connection attempt
net.setDefaultAutoSelectFamilyAttemptTimeout(platformTimeout(net.getDefaultAutoSelectFamilyAttemptTimeout() * 10));
@ -256,7 +256,7 @@ function platformTimeout(ms) {
if (exports.isAIX || exports.isIBMi)
return multipliers.two * ms; // Default localhost speed is slower on AIX
if (isPi)
if (isPi())
return multipliers.two * ms; // Raspberry Pi devices
if (isRiscv64) {

View file

@ -26,7 +26,7 @@ if (!common.hasCrypto) {
common.skip('node compiled without OpenSSL.');
}
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -26,7 +26,7 @@ if (!common.hasCrypto) {
common.skip('node compiled without OpenSSL.');
}
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -26,7 +26,7 @@ if (!common.hasCrypto) {
common.skip('missing crypto');
}
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -9,7 +9,7 @@ if (!common.isLinux) {
common.skip('The fs watch limit is OS-dependent');
}
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -3,7 +3,7 @@
// Check that spawn child doesn't create duplicated entries
const common = require('../common');
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -2,7 +2,7 @@
const common = require('../common');
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -3,7 +3,7 @@
const common = require('../common');
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -2,7 +2,7 @@
const common = require('../common');
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -22,7 +22,7 @@
'use strict';
const common = require('../common');
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -6,7 +6,7 @@ if (!common.hasCrypto) {
common.skip('missing crypto');
}
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

View file

@ -9,7 +9,7 @@ const common = require('../common');
// This test is basically `test-cluster-net-send` but creating lots of workers
// so the issue reproduces on OS X consistently.
if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}