From 3630dbf8a40fa95bc4bec2116d29359d5b8dc489 Mon Sep 17 00:00:00 2001 From: LaukikOnWindows Date: Sun, 12 Mar 2023 14:38:54 +0530 Subject: [PATCH] Fixed #482 --- lib/run.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/run.js b/lib/run.js index 7111b7d9..31b6a174 100644 --- a/lib/run.js +++ b/lib/run.js @@ -152,9 +152,11 @@ function run (opts, tracker, cb) { const restartFn = () => { stop = false - stopTimer = setTimeout(() => { - stop = true - }, opts.duration * 1000) + if (!amount) { + stopTimer = setTimeout(() => { + stop = true + }, opts.duration * 1000) + } errors = 0 timeouts = 0 mismatches = 0 @@ -167,6 +169,7 @@ function run (opts, tracker, cb) { latencies.reset() throughput.reset() startTime = Date.now() + numRunning = opts.connections // reinitialise clients if (opts.overallRate && (opts.overallRate < opts.connections)) opts.connections = opts.overallRate