From a3d5d4bce5c81c666f6636e06babbb8b4da08737 Mon Sep 17 00:00:00 2001 From: BethGriggs 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. --- 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;