From 0b6a84a8614e473a1c85205fba15b9133ec28294 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 28 Jul 2019 22:35:31 +0200 Subject: [PATCH] test,report: relax CPU match requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: Trivikram Kamat Reviewed-By: Сковорода Никита Андреевич Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- test/common/report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/report.js b/test/common/report.js index 0392cd2e9ba394..be1da58ff99a3c 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());