From cc3d70c7d310093f97aab7c4c5caf8c5ec4918d3 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 14 Aug 2021 11:45:49 +0200 Subject: [PATCH] testQuitErrors: Make it slightly less flaky with solanum? --- irctest/server_tests/connection_registration.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/irctest/server_tests/connection_registration.py b/irctest/server_tests/connection_registration.py index acef5f7..07abb97 100644 --- a/irctest/server_tests/connection_registration.py +++ b/irctest/server_tests/connection_registration.py @@ -88,10 +88,14 @@ class ConnectionRegistrationTestCase(cases.BaseServerTestCase): self.connectClient("foo") self.getMessages(1) self.sendLine(1, "QUIT") - try: - commands = {m.command for m in self.getMessages(1)} - except ConnectionClosed: - assert False, "Connection closed without ERROR." + while True: + try: + new_messages = self.getMessages(1) + if not new_messages: + break + commands = {m.command for m in new_messages} + except ConnectionClosed: + break self.assertIn( "ERROR", commands, fail_msg="Did not receive ERROR as a reply to QUIT." )