summaryrefslogtreecommitdiff
path: root/test/common
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-07-28 22:35:31 +0200
committerRich Trott <rtrott@gmail.com>2019-07-29 10:10:25 -0700
commit98d8ed64ff850a2a76685112886c22faa30e156d (patch)
tree3cbc3557da2b6e92d9ffd296d1e2d16f3e1d0236 /test/common
parent92ca2c208bf8c1a8abb21df800619b2890f72461 (diff)
downloadandroid-node-v8-98d8ed64ff850a2a76685112886c22faa30e156d.tar.gz
android-node-v8-98d8ed64ff850a2a76685112886c22faa30e156d.tar.bz2
android-node-v8-98d8ed64ff850a2a76685112886c22faa30e156d.zip
test,report: relax CPU match requirements
Some CPUs have variable speeds, and so exact matches between what `os.cpus()` and the report feature yield cannot always be expected: ``` >const results = [] >setInterval(() => results.push(os.cpus().map(({ speed }) => speed)), 1) [...] >results [ [ 1198, 1150, 1195, 1149 ], [ 1198, 1150, 1195, 1149 ], [ 1198, 1150, 1195, 1149 ], [ 1198, 1150, 1195, 1149 ], [ 2401, 2420, 2429, 2413 ], [ 2401, 2420, 2429, 2413 ], [ 2401, 2420, 2429, 2413 ], [ 2401, 2420, 2429, 2413 ], [ 2401, 2420, 2429, 2413 ], [ 2401, 2420, 2429, 2413 ], [ 2401, 2420, 2429, 2413 ], [ 2596, 2401, 2699, 2555 ], [...] ``` Refs: https://github.com/nodejs/node/pull/28829 PR-URL: https://github.com/nodejs/node/pull/28884 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/common')
-rw-r--r--test/common/report.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/common/report.js b/test/common/report.js
index 0392cd2e9b..be1da58ff9 100644
--- a/test/common/report.js
+++ b/test/common/report.js
@@ -109,7 +109,7 @@ function _validateContent(report) {
assert.strictEqual(typeof cpu.idle, 'number');
assert.strictEqual(typeof cpu.irq, 'number');
assert(cpus.some((c) => {
- return c.model === cpu.model && c.speed === cpu.speed;
+ return c.model === cpu.model;
}));
});
assert.strictEqual(header.host, os.hostname());