Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-2268

Close clients created in test suite

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.11
    • None
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              shane.harvey@mongodb.com Shane Harvey
              shane.harvey@mongodb.com Shane Harvey
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: