Skip to content

Commit

Permalink
Close persistent client connection at end of run (#13981)
Browse files Browse the repository at this point in the history
The persistent client connection increases our thread count
beyond what this test expects. This commit closes it since the
connection shouldn't be needed anymore by this point in the
test run.
  • Loading branch information
anodos325 authored Jul 5, 2024
1 parent 26f6de4 commit 14e92b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/api2/test_zzz_tests_completed.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down

0 comments on commit 14e92b6

Please sign in to comment.