-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
MongoClients created in our test suite often go unclosed. We assume that they will eventually be garbage collected. However, the unittest module internally keeps TestCase instances alive so any clients attached to an instance will be kept alive. A quick investigation shows over 50 unclosed MongoClients handing around at the end of the test suite. These clients consume resources (threads, sockets, CPU time) and make the tests slower.
We should close these clients and add an assertion at the end of the test suite to make sure all clients are closed.
- is related to
-
PYTHON-2286 Check for unclosed PeriodicExecutors at the end of the test suite
- Backlog
-
PYTHON-2284 Delay starting pymongo_kill_cursors_thread when connect=False
- Closed
- related to
-
PYTHON-2123 Reduce Client Time To Recovery On Topology Changes
- Closed