File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -483,10 +483,14 @@ async def teardown():
483483
484484 self .addAsyncCleanup (teardown )
485485
486- # Run a regex operation to slow down the query.
486+ # Make sure the collection has at least one document.
487+ await client .test .test .delete_many ({})
488+ await client .test .test .insert_one ({})
489+
490+ # Run a slow operation to tie up the connection.
487491 async def target ():
488492 try :
489- await client .test .test .find_one ({"$where" : delay (0.05 )})
493+ await client .test .test .find_one ({"$where" : delay (0.1 )})
490494 except OperationFailure :
491495 pass
492496
Original file line number Diff line number Diff line change @@ -477,10 +477,14 @@ def teardown():
477477
478478 self .addCleanup (teardown )
479479
480- # Run a regex operation to slow down the query.
480+ # Make sure the collection has at least one document.
481+ client .test .test .delete_many ({})
482+ client .test .test .insert_one ({})
483+
484+ # Run a slow operation to tie up the connection.
481485 def target ():
482486 try :
483- client .test .test .find_one ({"$where" : delay (0.05 )})
487+ client .test .test .find_one ({"$where" : delay (0.1 )})
484488 except OperationFailure :
485489 pass
486490
You can’t perform that action at this time.
0 commit comments