From fc68bf22a9525def6b10f2a03a59e80723f7ea85 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 24 Feb 2020 08:17:28 -0800 Subject: [PATCH 1/2] test: fix typo in common/index.js All tests using enoughTestCpu checks are always having the checks come back false due to a typo in common/index.js. Fix the typo. PR-URL: https://github.com/nodejs/node/pull/31931 Reviewed-By: Denys Otrishko Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: Yongsheng Zhang Reviewed-By: Anna Henningsen --- test/common/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/index.js b/test/common/index.js index 2e2d14dc0e6d43..1e66e32c9c1260 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -717,7 +717,7 @@ module.exports = { skipIfReportDisabled, skipIfWorker, - get enoughTestCPU() { + get enoughTestCpu() { const cpus = require('os').cpus(); return Array.isArray(cpus) && (cpus.length > 1 || cpus[0].speed > 999); }, From 8824229787dd7e28c14bdb6e5f3dcb8dd5ed813d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 24 Feb 2020 08:21:33 -0800 Subject: [PATCH 2/2] test: add documentation for common.enoughTestCpu PR-URL: https://github.com/nodejs/node/pull/31931 Reviewed-By: Denys Otrishko Reviewed-By: Ruben Bridgewater Reviewed-By: Luigi Pinca Reviewed-By: Yongsheng Zhang Reviewed-By: Anna Henningsen --- test/common/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/common/README.md b/test/common/README.md index d43b0ebbff39af..5479a39d8c215c 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -68,6 +68,13 @@ sure no unexpected rejections occur, because currently they result in silent failures. However, it is useful in some rare cases to disable it, for example if the `unhandledRejection` hook is directly used by the test. +### `enoughTestCpu` + +* [<boolean>][] + +Indicates if there is more than 1 CPU or that the single CPU has a speed of at +least 1 GHz. + ### `enoughTestMem` * [<boolean>][]