diff --git a/test/common/index.js b/test/common/index.js index 65d5a7f640d..4921fb5fa8e 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -120,6 +120,17 @@ const isFreeBSD = process.platform === 'freebsd'; const isOpenBSD = process.platform === 'openbsd'; const isLinux = process.platform === 'linux'; const isOSX = process.platform === 'darwin'; +const 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 + // work inside a container. Match the chipset model number instead. + const cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }); + return /^Hardware\s*:\s*(.*)$/im.exec(cpuinfo)?.[1] === 'BCM2835'; + } catch { + return false; + } +})(); const isDumbTerminal = process.env.TERM === 'dumb'; @@ -246,15 +257,10 @@ function platformTimeout(ms) { if (isAIX) return multipliers.two * ms; // Default localhost speed is slower on AIX - if (process.arch !== 'arm') - return ms; - - const armv = process.config.variables.arm_version; - - if (armv === '7') - return multipliers.two * ms; // ARMv7 + if (isPi) + return multipliers.two * ms; // Raspberry Pi devices - return ms; // ARMv8+ + return ms; } let knownGlobals = [ @@ -792,6 +798,7 @@ const common = { isMainThread, isOpenBSD, isOSX, + isPi, isSunOS, isWindows, localIPv6Hosts, diff --git a/test/pummel/test-crypto-dh-hash-modp18.js b/test/pummel/test-crypto-dh-hash-modp18.js index e2a7f43c450..ceb4cbd885c 100644 --- a/test/pummel/test-crypto-dh-hash-modp18.js +++ b/test/pummel/test-crypto-dh-hash-modp18.js @@ -26,8 +26,8 @@ if (!common.hasCrypto) { common.skip('node compiled without OpenSSL.'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const assert = require('assert'); diff --git a/test/pummel/test-crypto-dh-hash.js b/test/pummel/test-crypto-dh-hash.js index a5932eb7647..3ad974ff329 100644 --- a/test/pummel/test-crypto-dh-hash.js +++ b/test/pummel/test-crypto-dh-hash.js @@ -26,8 +26,8 @@ if (!common.hasCrypto) { common.skip('node compiled without OpenSSL.'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const assert = require('assert'); diff --git a/test/pummel/test-crypto-dh-keys.js b/test/pummel/test-crypto-dh-keys.js index 99be0e517fd..2caa4e244a9 100644 --- a/test/pummel/test-crypto-dh-keys.js +++ b/test/pummel/test-crypto-dh-keys.js @@ -26,8 +26,8 @@ if (!common.hasCrypto) { common.skip('node compiled without OpenSSL.'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const assert = require('assert'); diff --git a/test/pummel/test-dh-regr.js b/test/pummel/test-dh-regr.js index c55b7ff54d9..096b32f7150 100644 --- a/test/pummel/test-dh-regr.js +++ b/test/pummel/test-dh-regr.js @@ -26,8 +26,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const assert = require('assert'); diff --git a/test/pummel/test-fs-watch-system-limit.js b/test/pummel/test-fs-watch-system-limit.js index 20995c514fa..3486f5372b8 100644 --- a/test/pummel/test-fs-watch-system-limit.js +++ b/test/pummel/test-fs-watch-system-limit.js @@ -9,8 +9,8 @@ if (!common.isLinux) { common.skip('The fs watch limit is OS-dependent'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } try { diff --git a/test/pummel/test-hash-seed.js b/test/pummel/test-hash-seed.js index 42b626b079e..274183d8ce9 100644 --- a/test/pummel/test-hash-seed.js +++ b/test/pummel/test-hash-seed.js @@ -3,8 +3,8 @@ // Check that spawn child doesn't create duplicated entries const common = require('../common'); -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const kRepetitions = 2; diff --git a/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js b/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js index faf5c4755aa..dd7497d975a 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit-bounded.js @@ -2,8 +2,8 @@ const common = require('../common'); -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const tmpdir = require('../common/tmpdir'); diff --git a/test/pummel/test-heapsnapshot-near-heap-limit.js b/test/pummel/test-heapsnapshot-near-heap-limit.js index 420ba042059..1af4e61e08c 100644 --- a/test/pummel/test-heapsnapshot-near-heap-limit.js +++ b/test/pummel/test-heapsnapshot-near-heap-limit.js @@ -2,8 +2,8 @@ const common = require('../common'); -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const tmpdir = require('../common/tmpdir'); diff --git a/test/pummel/test-net-bytes-per-incoming-chunk-overhead.js b/test/pummel/test-net-bytes-per-incoming-chunk-overhead.js index f556e9881f7..b3613110ab5 100644 --- a/test/pummel/test-net-bytes-per-incoming-chunk-overhead.js +++ b/test/pummel/test-net-bytes-per-incoming-chunk-overhead.js @@ -7,8 +7,8 @@ if (process.config.variables.asan) { common.skip('ASAN messes with memory measurements'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const assert = require('assert'); diff --git a/test/pummel/test-next-tick-infinite-calls.js b/test/pummel/test-next-tick-infinite-calls.js index bf837f5ebc9..d1131066977 100644 --- a/test/pummel/test-next-tick-infinite-calls.js +++ b/test/pummel/test-next-tick-infinite-calls.js @@ -22,8 +22,8 @@ 'use strict'; const common = require('../common'); -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } let complete = 0; diff --git a/test/pummel/test-policy-integrity-dep.js b/test/pummel/test-policy-integrity-dep.js index ec58462335c..02f24d02a23 100644 --- a/test/pummel/test-policy-integrity-dep.js +++ b/test/pummel/test-policy-integrity-dep.js @@ -6,8 +6,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } common.requireNoPackageJSONAbove(); diff --git a/test/pummel/test-policy-integrity-parent-commonjs.js b/test/pummel/test-policy-integrity-parent-commonjs.js index 39febab73ee..425abe38ebd 100644 --- a/test/pummel/test-policy-integrity-parent-commonjs.js +++ b/test/pummel/test-policy-integrity-parent-commonjs.js @@ -6,8 +6,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } common.requireNoPackageJSONAbove(); diff --git a/test/pummel/test-policy-integrity-parent-module.js b/test/pummel/test-policy-integrity-parent-module.js index e60a606ea32..dda800dc365 100644 --- a/test/pummel/test-policy-integrity-parent-module.js +++ b/test/pummel/test-policy-integrity-parent-module.js @@ -6,8 +6,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } common.requireNoPackageJSONAbove(); diff --git a/test/pummel/test-policy-integrity-parent-no-package-json.js b/test/pummel/test-policy-integrity-parent-no-package-json.js index f2208744447..a722263e1e4 100644 --- a/test/pummel/test-policy-integrity-parent-no-package-json.js +++ b/test/pummel/test-policy-integrity-parent-no-package-json.js @@ -6,8 +6,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } common.requireNoPackageJSONAbove(); diff --git a/test/pummel/test-policy-integrity-worker-commonjs.js b/test/pummel/test-policy-integrity-worker-commonjs.js index 22a7d762466..b5d49222a2f 100644 --- a/test/pummel/test-policy-integrity-worker-commonjs.js +++ b/test/pummel/test-policy-integrity-worker-commonjs.js @@ -6,8 +6,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } common.requireNoPackageJSONAbove(); diff --git a/test/pummel/test-policy-integrity-worker-module.js b/test/pummel/test-policy-integrity-worker-module.js index e5d4e4cd45d..a8a4fb2c295 100644 --- a/test/pummel/test-policy-integrity-worker-module.js +++ b/test/pummel/test-policy-integrity-worker-module.js @@ -6,8 +6,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } common.requireNoPackageJSONAbove(); diff --git a/test/pummel/test-policy-integrity-worker-no-package-json.js b/test/pummel/test-policy-integrity-worker-no-package-json.js index 808687f40ea..e5b3e3ccfab 100644 --- a/test/pummel/test-policy-integrity-worker-no-package-json.js +++ b/test/pummel/test-policy-integrity-worker-no-package-json.js @@ -6,8 +6,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } common.requireNoPackageJSONAbove(); diff --git a/test/pummel/test-webcrypto-derivebits-pbkdf2.js b/test/pummel/test-webcrypto-derivebits-pbkdf2.js index 512662025c6..e7ed4f6bd64 100644 --- a/test/pummel/test-webcrypto-derivebits-pbkdf2.js +++ b/test/pummel/test-webcrypto-derivebits-pbkdf2.js @@ -6,8 +6,8 @@ if (!common.hasCrypto) { common.skip('missing crypto'); } -if (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const assert = require('assert'); diff --git a/test/sequential/test-child-process-pass-fd.js b/test/sequential/test-child-process-pass-fd.js index ad4e5d693ee..86092f56da8 100644 --- a/test/sequential/test-child-process-pass-fd.js +++ b/test/sequential/test-child-process-pass-fd.js @@ -9,8 +9,8 @@ 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 (process.config.variables.arm_version === '7') { - common.skip('Too slow for armv7 bots'); +if (common.isPi) { + common.skip('Too slow for Raspberry Pi devices'); } const assert = require('assert');