From 776d291a07a8f2fd139d3aba4c1d33b86c09ed8e Mon Sep 17 00:00:00 2001 From: Bethany Griggs Date: Tue, 15 Nov 2016 11:14:16 +0000 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/9616 Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: Evan Lucas Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell --- test/common.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/common.js b/test/common.js index e0ce68c835b483..3bbf7d87300ccc 100644 --- a/test/common.js +++ b/test/common.js @@ -32,7 +32,8 @@ exports.isOSX = process.platform === 'darwin'; exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */ const cpus = os.cpus(); -exports.enoughTestCpu = cpus.length > 1 || cpus[0].speed > 999; +exports.enoughTestCpu = Array.isArray(cpus) && + (cpus.length > 1 || cpus[0].speed > 999); exports.rootDir = exports.isWindows ? 'c:\\' : '/'; exports.buildType = process.config.target_defaults.default_configuration;