From 957532ec6122a093ac024183f615604ba11a8d40 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Wed, 18 Apr 2018 12:34:04 +0200 Subject: [PATCH] test: fix long-running http benchmarks PR-URL: https://github.com/nodejs/node/pull/20125 Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott --- benchmark/http/cluster.js | 4 ++-- test/sequential/test-benchmark-http.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/benchmark/http/cluster.js b/benchmark/http/cluster.js index 56393fa1ab0..667e826f163 100644 --- a/benchmark/http/cluster.js +++ b/benchmark/http/cluster.js @@ -26,7 +26,7 @@ function main({ type, len, c }) { if (workers < 2) return; - setTimeout(function() { + setImmediate(function() { const path = `/${type}/${len}`; bench.http({ @@ -36,6 +36,6 @@ function main({ type, len, c }) { w1.destroy(); w2.destroy(); }); - }, 100); + }); }); } diff --git a/test/sequential/test-benchmark-http.js b/test/sequential/test-benchmark-http.js index e23a4a1753b..13d0e4d16aa 100644 --- a/test/sequential/test-benchmark-http.js +++ b/test/sequential/test-benchmark-http.js @@ -18,12 +18,14 @@ runBenchmark('http', 'chunkedEnc=true', 'chunks=0', 'dur=0.1', + 'input=keep-alive', 'key=""', 'len=1', 'method=write', 'n=1', 'res=normal', - 'type=asc' + 'type=asc', + 'value=X-Powered-By' ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1,