File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ def run_scenario(self):
9797 error = None
9898
9999 db = rs_or_single_client (** test ['clientOptions' ]).pymongo_test
100+ # Close the client explicitly to avoid having too many threads open.
101+ self .addCleanup (db .client .close )
100102 try :
101103 result = run_operation (db .test , test )
102104 except (ConnectionFailure , OperationFailure ) as exc :
Original file line number Diff line number Diff line change @@ -347,6 +347,8 @@ def run_scenario(self):
347347 # with ScenarioDict.
348348 client = rs_client (event_listeners = [listener ],
349349 ** dict (test ['clientOptions' ]))
350+ # Close the client explicitly to avoid having too many threads open.
351+ self .addCleanup (client .close )
350352
351353 # Kill all sessions before and after each test to prevent an open
352354 # transaction (from a test failure) from blocking collection/database
You can’t perform that action at this time.
0 commit comments