Skip to content

Commit c63f3af

Browse files
BethGriggsMylesBorins
authored andcommitted
test: run tests even if os.cpus() fails
Currently if the os.cpus() call fails every test will fail. As there is already a test for os.cpus(), the other tests should run even if the os.cpus() call fails. PR-URL: #9616 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent ce17737 commit c63f3af

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/common.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ exports.isOSX = process.platform === 'darwin';
3232
exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */
3333

3434
const cpus = os.cpus();
35-
exports.enoughTestCpu = cpus.length > 1 || cpus[0].speed > 999;
35+
exports.enoughTestCpu = Array.isArray(cpus) &&
36+
(cpus.length > 1 || cpus[0].speed > 999);
3637

3738
exports.rootDir = exports.isWindows ? 'c:\\' : '/';
3839
exports.buildType = process.config.target_defaults.default_configuration;

0 commit comments

Comments
 (0)