◐ Shell
clean mode source ↗

test: remove unnecessary syscall to cpuinfo · nodejs/node@60c8fc0

Original file line numberDiff line numberDiff line change

@@ -124,7 +124,7 @@ const isMacOS = process.platform === 'darwin';

124124

const isASan = process.config.variables.asan === 1;

125125

const isRiscv64 = process.arch === 'riscv64';

126126

const isDebug = process.features.debug;

127-

const isPi = (() => {

127+

function isPi() {

128128

try {

129129

// Normal Raspberry Pi detection is to find the `Raspberry Pi` string in

130130

// the contents of `/sys/firmware/devicetree/base/model` but that doesn't

@@ -136,7 +136,7 @@ const isPi = (() => {

136136

} catch {

137137

return false;

138138

}

139-

})();

139+

}

140140
141141

// When using high concurrency or in the CI we need much more time for each connection attempt

142142

net.setDefaultAutoSelectFamilyAttemptTimeout(platformTimeout(net.getDefaultAutoSelectFamilyAttemptTimeout() * 10));

@@ -256,7 +256,7 @@ function platformTimeout(ms) {

256256

if (exports.isAIX || exports.isIBMi)

257257

return multipliers.two * ms; // Default localhost speed is slower on AIX

258258
259-

if (isPi)

259+

if (isPi())

260260

return multipliers.two * ms; // Raspberry Pi devices

261261
262262

if (isRiscv64) {