test: run misc benchmark only once in tests

Prevent misc benchmark files from running more than one benchmark
during tests.

PR-URL: https://github.com/nodejs/node/pull/21046
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Rich Trott 2018-05-31 19:46:17 +02:00
parent 8944a4f162
commit 5d4c5d3f71
2 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,10 @@ const bench = common.createBenchmark(main, {
});
function main({ n, type }) {
// Default value for tests.
if (type === '')
type = 'extend';
let fn;
if (type === 'extend') {
fn = util._extend;

View File

@ -9,6 +9,6 @@ runBenchmark('misc', [
'dur=0.1',
'method=',
'n=1',
'type=extend',
'val=magyarország.icom.museum'
'type=',
'val=magyarország.icom.museum',
], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 });