Close clients created in test suite

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 3.11
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • 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.

            Assignee:
            Shane Harvey
            Reporter:
            Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: