node/test/sequential/test-benchmark-worker.js
Muzafar Umarov 8059ff2f0b
benchmark: added a test benchmark for worker
Wrote a sequential benchmark test for worker.
This is to make sure the benchmark for work runs properly.

PR-URL: https://github.com/nodejs/node/pull/23475
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-10-14 22:12:49 +02:00

24 lines
654 B
JavaScript

'use strict';
const common = require('../common');
if (!common.enoughTestMem)
common.skip('Insufficient memory for Worker benchmark test');
// Because the worker benchmarks can run on different threads,
// this should be in sequential rather than parallel to make sure
// it does not conflict with tests that choose random available ports.
const runBenchmark = require('../common/benchmark');
runBenchmark('worker',
[
'n=1',
'sendsPerBroadcast=1',
'workers=1',
'payload=string'
],
{
NODEJS_BENCHMARK_ZERO_ALLOWED: 1
});