Skip to content

Commit 71f4228

Browse files
test,mobile: assume enough CPU resources
Assumes there is enough CPU resources while running tests on iOS and Android. On mobile platforms, accessing CPU information can be blocked by the OS.
1 parent c7ea4ab commit 71f4228

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/common/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,15 @@ exports.isAndroid = process.platform === 'android';
5757
exports.isIOS = process.platform === 'ios';
5858

5959
exports.enoughTestMem = os.totalmem() > 0x40000000; /* 1 Gb */
60-
const cpus = os.cpus();
61-
exports.enoughTestCpu = Array.isArray(cpus) &&
62-
(cpus.length > 1 || cpus[0].speed > 999);
60+
61+
if(exports.isAndroid || exports.isIOS) {
62+
// On mobile platforms, CPU information might be unavailable.
63+
exports.enoughTestCpu = true;
64+
} else {
65+
const cpus = os.cpus();
66+
exports.enoughTestCpu = Array.isArray(cpus) &&
67+
(cpus.length > 1 || cpus[0].speed > 999);
68+
}
6369

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

0 commit comments

Comments
 (0)