From c63f3afbc156293ccf29c14427bc98534ec49de5 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 d1d9c7876faa5c..a428bd98032a02 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;