@@ -210,19 +210,24 @@ async def asyncSetUp(self):
210
210
211
211
async def do_task (self ):
212
212
command = self .client .perftest .command
213
- await asyncio .gather (* [command ("hello" , True ) for _ in range (NUM_DOCS )])
213
+ for _ in range (NUM_DOCS ):
214
+ await command ("hello" , True )
214
215
215
216
216
217
class TestRunCommand8Tasks (TestRunCommand ):
217
218
n_tasks = 8
218
219
220
+ async def do_task (self ):
221
+ command = self .client .perftest .command
222
+ await asyncio .gather (* [command ("hello" , True ) for _ in range (NUM_DOCS )])
223
+
219
224
220
225
class TestRunCommand80Tasks (TestRunCommand ):
221
226
n_tasks = 80
222
227
223
-
224
- # class TestRunCommand800Tasks(TestRunCommand):
225
- # n_tasks = 800
228
+ async def do_task ( self ):
229
+ command = self . client . perftest . command
230
+ await asyncio . gather ( * [ command ( "hello" , True ) for _ in range ( NUM_DOCS )])
226
231
227
232
228
233
class TestDocument (PerformanceTest ):
@@ -269,19 +274,24 @@ async def after(self):
269
274
class TestFindOneByID (FindTest , AsyncPyMongoTestCase ):
270
275
async def do_task (self ):
271
276
find_one = self .corpus .find_one
272
- await asyncio .gather (* [find_one ({"_id" : _id }) for _id in self .inserted_ids ])
277
+ for _id in range (self .inserted_ids ):
278
+ await find_one ({"_id" : _id })
273
279
274
280
275
281
class TestFindOneByID8Tasks (TestFindOneByID ):
276
282
n_tasks = 8
277
283
284
+ async def do_task (self ):
285
+ find_one = self .corpus .find_one
286
+ await asyncio .gather (* [find_one ({"_id" : _id }) for _id in self .inserted_ids ])
287
+
278
288
279
289
class TestFindOneByID80Tasks (TestFindOneByID ):
280
290
n_tasks = 80
281
291
282
-
283
- # class TestFindOneByID800Tasks(TestFindOneByID):
284
- # n_tasks = 800
292
+ async def do_task ( self ):
293
+ find_one = self . corpus . find_one
294
+ await asyncio . gather ( * [ find_one ({ "_id" : _id }) for _id in self . inserted_ids ])
285
295
286
296
287
297
class SmallDocInsertTest (TestDocument ):
@@ -338,10 +348,6 @@ class TestFindManyAndEmptyCursor80Tasks(TestFindManyAndEmptyCursor):
338
348
n_tasks = 80
339
349
340
350
341
- # class TestFindManyAndEmptyCursor800Tasks(TestFindManyAndEmptyCursor):
342
- # n_tasks = 800
343
-
344
-
345
351
class TestSmallDocBulkInsert (SmallDocInsertTest , AsyncPyMongoTestCase ):
346
352
async def do_task (self ):
347
353
await self .corpus .insert_many (self .documents , ordered = True )
0 commit comments