Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove unnecessary syscall to cpuinfo #56968

Merged
merged 1 commit into from
Feb 10, 2025
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
6 changes: 3 additions & 3 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-crypto-dh-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-crypto-dh-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-dh-regr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-fs-watch-system-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-hash-seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-heapsnapshot-near-heap-limit-bounded.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const common = require('../common');

if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-heapsnapshot-near-heap-limit-by-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const common = require('../common');

if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-heapsnapshot-near-heap-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const common = require('../common');

if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-next-tick-infinite-calls.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
'use strict';
const common = require('../common');

if (common.isPi) {
if (common.isPi()) {
common.skip('Too slow for Raspberry Pi devices');
}

Expand Down
2 changes: 1 addition & 1 deletion test/pummel/test-webcrypto-derivebits-pbkdf2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-child-process-pass-fd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
Loading