From 73f90e0ff8a92f977c0f945a2e0d85b2832c41ca Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Sat, 8 Feb 2025 17:13:34 -0500 Subject: [PATCH] test: remove unnecessary syscall to cpuinfo --- test/common/index.js | 6 +++--- test/pummel/test-crypto-dh-hash.js | 2 +- test/pummel/test-crypto-dh-keys.js | 2 +- test/pummel/test-dh-regr.js | 2 +- test/pummel/test-fs-watch-system-limit.js | 2 +- test/pummel/test-hash-seed.js | 2 +- test/pummel/test-heapsnapshot-near-heap-limit-bounded.js | 2 +- test/pummel/test-heapsnapshot-near-heap-limit-by-api.js | 2 +- test/pummel/test-heapsnapshot-near-heap-limit.js | 2 +- test/pummel/test-next-tick-infinite-calls.js | 2 +- test/pummel/test-webcrypto-derivebits-pbkdf2.js | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/common/index.js b/test/common/index.js index 8113f604dfcdb64..e27603cda8741e5 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -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) { diff --git a/test/pummel/test-crypto-dh-hash.js b/test/pummel/test-crypto-dh-hash.js index b59f556a2042b92..03b4a9c831ae335 100644 --- a/test/pummel/test-crypto-dh-hash.js +++ b/test/pummel/test-crypto-dh-hash.js @@ -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'); } diff --git a/test/pummel/test-crypto-dh-keys.js b/test/pummel/test-crypto-dh-keys.js index abce6a07acf4ac2..ba67bc5717af622 100644 --- a/test/pummel/test-crypto-dh-keys.js +++ b/test/pummel/test-crypto-dh-keys.js @@ -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'); } diff --git a/test/pummel/test-dh-regr.js b/test/pummel/test-dh-regr.js index cfae57d0728bdb3..961bea3246fb178 100644 --- a/test/pummel/test-dh-regr.js +++ b/test/pummel/test-dh-regr.js @@ -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'); } diff --git a/test/pummel/test-fs-watch-system-limit.js b/test/pummel/test-fs-watch-system-limit.js index 3486f5372b8d5d1..9be53017ae87883 100644 --- a/test/pummel/test-fs-watch-system-limit.js +++ b/test/pummel/test-fs-watch-system-limit.js @@ -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'); } diff --git a/test/pummel/test-hash-seed.js b/test/pummel/test-hash-seed.js index 265226e1714fe27..be98037c827466d 100644 --- a/test/pummel/test-hash-seed.js +++ b/test/pummel/test-hash-seed.js @@ -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'); } diff --git a/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js b/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js index 84a84b3a1cee6c5..45f11367622c075 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js @@ -2,7 +2,7 @@ const common = require('../common'); -if (common.isPi) { +if (common.isPi()) { common.skip('Too slow for Raspberry Pi devices'); } diff --git a/test/pummel/test-heapsnapshot-near-heap-limit-by-api.js b/test/pummel/test-heapsnapshot-near-heap-limit-by-api.js index ade2ea347db68bc..9a412efb5b31586 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit-by-api.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit-by-api.js @@ -3,7 +3,7 @@ const common = require('../common'); -if (common.isPi) { +if (common.isPi()) { common.skip('Too slow for Raspberry Pi devices'); } diff --git a/test/pummel/test-heapsnapshot-near-heap-limit.js b/test/pummel/test-heapsnapshot-near-heap-limit.js index 78ff941f126410b..4cd61bf3e5af7c2 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit.js @@ -2,7 +2,7 @@ const common = require('../common'); -if (common.isPi) { +if (common.isPi()) { common.skip('Too slow for Raspberry Pi devices'); } diff --git a/test/pummel/test-next-tick-infinite-calls.js b/test/pummel/test-next-tick-infinite-calls.js index d1131066977ea2a..7769eec8aedcf0a 100644 --- a/test/pummel/test-next-tick-infinite-calls.js +++ b/test/pummel/test-next-tick-infinite-calls.js @@ -22,7 +22,7 @@ 'use strict'; const common = require('../common'); -if (common.isPi) { +if (common.isPi()) { common.skip('Too slow for Raspberry Pi devices'); } diff --git a/test/pummel/test-webcrypto-derivebits-pbkdf2.js b/test/pummel/test-webcrypto-derivebits-pbkdf2.js index 242bb080d823680..28c6fe871c578b9 100644 --- a/test/pummel/test-webcrypto-derivebits-pbkdf2.js +++ b/test/pummel/test-webcrypto-derivebits-pbkdf2.js @@ -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'); }