PYTHON-1590 Avoid thread limit in tests
This commit is contained in:
parent
b5e9007af0
commit
9d8024d9ea
@ -97,6 +97,8 @@ def create_test(scenario_def, test):
|
||||
error = None
|
||||
|
||||
db = rs_or_single_client(**test['clientOptions']).pymongo_test
|
||||
# Close the client explicitly to avoid having too many threads open.
|
||||
self.addCleanup(db.client.close)
|
||||
try:
|
||||
result = run_operation(db.test, test)
|
||||
except (ConnectionFailure, OperationFailure) as exc:
|
||||
|
||||
@ -347,6 +347,8 @@ def create_test(scenario_def, test):
|
||||
# with ScenarioDict.
|
||||
client = rs_client(event_listeners=[listener],
|
||||
**dict(test['clientOptions']))
|
||||
# Close the client explicitly to avoid having too many threads open.
|
||||
self.addCleanup(client.close)
|
||||
|
||||
# Kill all sessions before and after each test to prevent an open
|
||||
# transaction (from a test failure) from blocking collection/database
|
||||
|
||||
Loading…
Reference in New Issue
Block a user