From a7f620d3c9cfd5f49f5e579b24913a2639f610bb Mon Sep 17 00:00:00 2001 From: catborise Date: Sun, 8 Nov 2026 22:38:07 +0300 Subject: [PATCH] test(connection): the thread tests wait for the opens they started ConnectionThreadsTestCase, like BoundedOpenTestCase, released its blocked opens when a test ended without waiting for them, so an open could still end during the next test. Its cleanup joins the threads the test started. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea --- vrtManager/tests/test_connection_threads.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vrtManager/tests/test_connection_threads.py b/vrtManager/tests/test_connection_threads.py index c4173e9a..b6b85584 100644 --- a/vrtManager/tests/test_connection_threads.py +++ b/vrtManager/tests/test_connection_threads.py @@ -24,9 +24,16 @@ class ConnectionThreadsTestCase(unittest.TestCase): self.addCleanup(patcher.stop) self.manager = wvmConnectionManager() self.release = threading.Event() - self.addCleanup(self.release.set) + self.threads = set(threading.enumerate()) + self.addCleanup(self.finish_opens) self.opened = [] + def finish_opens(self): + """Let every open this test started end: one ending later would run into another test.""" + self.release.set() + for thread in set(threading.enumerate()) - self.threads: + thread.join(5) + def open_auth(self, *conns): pending = list(conns)