Skip to content

Commit ab4de3d

Browse files
add retry threshold
1 parent bf11f12 commit ab4de3d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/benchmarks/mongoBench/runner.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,17 @@ class Runner {
162162
const minExecutionCount = this.minExecutionCount;
163163
const minExecutionTime = this.minExecutionTime;
164164
const maxExecutionTime = this.maxExecutionTime;
165+
const maxExecutionAttempts = 10000000;
165166
let time = performance.now() - start;
166167
let count = 1;
167168

168169
const taskTimer = benchmark._taskType === 'sync' ? timeSyncTask : timeAsyncTask;
169170

170-
while (time < maxExecutionTime && (time < minExecutionTime || count < minExecutionCount)) {
171+
while (
172+
time < maxExecutionTime &&
173+
(time < minExecutionTime || count < minExecutionCount) &&
174+
count < maxExecutionAttempts
175+
) {
171176
await benchmark.beforeTask.call(ctx);
172177
const executionTime = await taskTimer(benchmark.task, ctx);
173178
rawData.push(executionTime);

0 commit comments

Comments
 (0)