diff --git a/tests/api2/test_zzz_tests_completed.py b/tests/api2/test_zzz_tests_completed.py index 991ee67f94778..810ac9ccfb3ff 100644 --- a/tests/api2/test_zzz_tests_completed.py +++ b/tests/api2/test_zzz_tests_completed.py @@ -1,9 +1,16 @@ import faulthandler import threading +from middlewared.test.integration.utils.client import truenas_server + def test__thread_count(request): """Having outstanding threads can prevent python from exiting cleanly.""" + + # Tear down our persistent connection + truenas_server.client.close() + truenas_server._client = None + count = threading.active_count() if count > 1: faulthandler.dump_traceback()