From cdca587b3d56435df986f0f4dcc98c1cee1a9feb Mon Sep 17 00:00:00 2001 From: Muzafar Umarov Date: Fri, 12 Oct 2018 12:47:35 -0400 Subject: [PATCH] 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 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Trivikram Kamat --- test/sequential/test-benchmark-worker.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/sequential/test-benchmark-worker.js diff --git a/test/sequential/test-benchmark-worker.js b/test/sequential/test-benchmark-worker.js new file mode 100644 index 00000000000000..ae9a8a6701ae4a --- /dev/null +++ b/test/sequential/test-benchmark-worker.js @@ -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 + });