File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
test/benchmarks/mongoBench Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments