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>
This commit is contained in:
parent
ff3c56c792
commit
8059ff2f0b
23
test/sequential/test-benchmark-worker.js
Normal file
23
test/sequential/test-benchmark-worker.js
Normal file
@ -0,0 +1,23 @@
|
||||
'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
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user