aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMuzafar Umarov <umarov@gmail.com>2018-10-12 12:47:35 -0400
committerAnna Henningsen <anna@addaleax.net>2018-10-14 22:12:49 +0200
commit8059ff2f0b01a4ee5c9da6c5db6b256f0c4ed42c (patch)
tree34c3735290f501a5ffb7e2114fbaa6815c672250 /test
parentff3c56c7929e1b56b319c666599175e8cf5f1da5 (diff)
downloadandroid-node-v8-8059ff2f0b01a4ee5c9da6c5db6b256f0c4ed42c.tar.gz
android-node-v8-8059ff2f0b01a4ee5c9da6c5db6b256f0c4ed42c.tar.bz2
android-node-v8-8059ff2f0b01a4ee5c9da6c5db6b256f0c4ed42c.zip
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>
Diffstat (limited to 'test')
-rw-r--r--test/sequential/test-benchmark-worker.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/sequential/test-benchmark-worker.js b/test/sequential/test-benchmark-worker.js
new file mode 100644
index 0000000000..ae9a8a6701
--- /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
+ });