| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c6d8503 commit 8a19abc
21 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -120,6 +120,17 @@ const isFreeBSD = process.platform === 'freebsd'; | |||
| 120 | 120 | const isOpenBSD = process.platform === 'openbsd'; | |
| 121 | 121 | const isLinux = process.platform === 'linux'; | |
| 122 | 122 | const isOSX = process.platform === 'darwin'; | |
| 123 | + const isPi = (() => { | ||
| 124 | + try { | ||
| 125 | + // Normal Raspberry Pi detection is to find the `Raspberry Pi` string in | ||
| 126 | + // the contents of `/sys/firmware/devicetree/base/model` but that doesn't | ||
| 127 | + // work inside a container. Match the chipset model number instead. | ||
| 128 | + const cpuinfo = fs.readFileSync('/proc/cpuinfo', { encoding: 'utf8' }); | ||
| 129 | + return /^Hardware\s*:\s*(.*)$/im.exec(cpuinfo)?.[1] === 'BCM2835'; | ||
| 130 | + } catch { | ||
| 131 | + return false; | ||
| 132 | + } | ||
| 133 | + })(); | ||
| 123 | 134 | ||
| 124 | 135 | const isDumbTerminal = process.env.TERM === 'dumb'; | |
| 125 | 136 | ||
@@ -246,15 +257,10 @@ function platformTimeout(ms) { | |||
| 246 | 257 | if (isAIX) | |
| 247 | 258 | return multipliers.two * ms; // Default localhost speed is slower on AIX | |
| 248 | 259 | ||
| 249 | - if (process.arch !== 'arm') | ||
| 250 | - return ms; | ||
| 251 | - | ||
| 252 | - const armv = process.config.variables.arm_version; | ||
| 253 | - | ||
| 254 | - if (armv === '7') | ||
| 255 | - return multipliers.two * ms; // ARMv7 | ||
| 260 | + if (isPi) | ||
| 261 | + return multipliers.two * ms; // Raspberry Pi devices | ||
| 256 | 262 | ||
| 257 | - return ms; // ARMv8+ | ||
| 263 | + return ms; | ||
| 258 | 264 | } | |
| 259 | 265 | ||
| 260 | 266 | let knownGlobals = [ | |
@@ -790,6 +796,7 @@ const common = { | |||
| 790 | 796 | isMainThread, | |
| 791 | 797 | isOpenBSD, | |
| 792 | 798 | isOSX, | |
| 799 | + isPi, | ||
| 793 | 800 | isSunOS, | |
| 794 | 801 | isWindows, | |
| 795 | 802 | localIPv6Hosts, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,8 +26,8 @@ if (!common.hasCrypto) { | |||
| 26 | 26 | common.skip('node compiled without OpenSSL.'); | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | - if (process.config.variables.arm_version === '7') { | ||
| 30 | - common.skip('Too slow for armv7 bots'); | ||
| 29 | + if (common.isPi) { | ||
| 30 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | const assert = require('assert'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,8 +26,8 @@ if (!common.hasCrypto) { | |||
| 26 | 26 | common.skip('node compiled without OpenSSL.'); | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | - if (process.config.variables.arm_version === '7') { | ||
| 30 | - common.skip('Too slow for armv7 bots'); | ||
| 29 | + if (common.isPi) { | ||
| 30 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | const assert = require('assert'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,8 +26,8 @@ if (!common.hasCrypto) { | |||
| 26 | 26 | common.skip('node compiled without OpenSSL.'); | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | - if (process.config.variables.arm_version === '7') { | ||
| 30 | - common.skip('Too slow for armv7 bots'); | ||
| 29 | + if (common.isPi) { | ||
| 30 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | const assert = require('assert'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,8 +26,8 @@ if (!common.hasCrypto) { | |||
| 26 | 26 | common.skip('missing crypto'); | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | - if (process.config.variables.arm_version === '7') { | ||
| 30 | - common.skip('Too slow for armv7 bots'); | ||
| 29 | + if (common.isPi) { | ||
| 30 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | const assert = require('assert'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,8 +9,8 @@ if (!common.isLinux) { | |||
| 9 | 9 | common.skip('The fs watch limit is OS-dependent'); | |
| 10 | 10 | } | |
| 11 | 11 | ||
| 12 | - if (process.config.variables.arm_version === '7') { | ||
| 13 | - common.skip('Too slow for armv7 bots'); | ||
| 12 | + if (common.isPi) { | ||
| 13 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 14 | 14 | } | |
| 15 | 15 | ||
| 16 | 16 | try { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,8 +3,8 @@ | |||
| 3 | 3 | // Check that spawn child doesn't create duplicated entries | |
| 4 | 4 | const common = require('../common'); | |
| 5 | 5 | ||
| 6 | - if (process.config.variables.arm_version === '7') { | ||
| 7 | - common.skip('Too slow for armv7 bots'); | ||
| 6 | + if (common.isPi) { | ||
| 7 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 8 | 8 | } | |
| 9 | 9 | ||
| 10 | 10 | const kRepetitions = 2; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | 3 | const common = require('../common'); | |
| 4 | 4 | ||
| 5 | - if (process.config.variables.arm_version === '7') { | ||
| 6 | - common.skip('Too slow for armv7 bots'); | ||
| 5 | + if (common.isPi) { | ||
| 6 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 7 | 7 | } | |
| 8 | 8 | ||
| 9 | 9 | const tmpdir = require('../common/tmpdir'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,8 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | 3 | const common = require('../common'); | |
| 4 | 4 | ||
| 5 | - if (process.config.variables.arm_version === '7') { | ||
| 6 | - common.skip('Too slow for armv7 bots'); | ||
| 5 | + if (common.isPi) { | ||
| 6 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 7 | 7 | } | |
| 8 | 8 | ||
| 9 | 9 | const tmpdir = require('../common/tmpdir'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,8 +7,8 @@ if (process.config.variables.asan) { | |||
| 7 | 7 | common.skip('ASAN messes with memory measurements'); | |
| 8 | 8 | } | |
| 9 | 9 | ||
| 10 | - if (process.config.variables.arm_version === '7') { | ||
| 11 | - common.skip('Too slow for armv7 bots'); | ||
| 10 | + if (common.isPi) { | ||
| 11 | + common.skip('Too slow for Raspberry Pi devices'); | ||
| 12 | 12 | } | |
| 13 | 13 | ||
| 14 | 14 | const assert = require('assert'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments