1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-08 22:38:07 +03:00
parent 9f323d709e
commit a7f620d3c9

View file

@ -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)