improved message tests which went stuck

This commit is contained in:
DJ2LS 2024-02-19 08:37:16 +01:00
parent 10be8db7d0
commit 35276b01ef

View file

@ -108,7 +108,7 @@ class TestMessageProtocol(unittest.TestCase):
def waitForSession(self, q, outbound=False):
key = 'arq-transfer-outbound' if outbound else 'arq-transfer-inbound'
while True:
while True and self.channels_running:
ev = q.get()
if key in ev and ('success' in ev[key] or 'ABORTED' in ev[key]):
self.logger.info(f"[{threading.current_thread().name}] {key} session ended.")
@ -130,6 +130,7 @@ class TestMessageProtocol(unittest.TestCase):
def waitAndCloseChannels(self):
self.waitForSession(self.iss_event_queue, True)
self.channels_running = False
self.waitForSession(self.irs_event_queue, False)
self.channels_running = False