testQuitErrors: Make it slightly less flaky with solanum?

This commit is contained in:
Valentin Lorentz 2021-08-14 11:45:49 +02:00 committed by Val Lorentz
parent ff0d795485
commit cc3d70c7d3

View File

@ -88,10 +88,14 @@ class ConnectionRegistrationTestCase(cases.BaseServerTestCase):
self.connectClient("foo") self.connectClient("foo")
self.getMessages(1) self.getMessages(1)
self.sendLine(1, "QUIT") self.sendLine(1, "QUIT")
while True:
try: try:
commands = {m.command for m in self.getMessages(1)} new_messages = self.getMessages(1)
if not new_messages:
break
commands = {m.command for m in new_messages}
except ConnectionClosed: except ConnectionClosed:
assert False, "Connection closed without ERROR." break
self.assertIn( self.assertIn(
"ERROR", commands, fail_msg="Did not receive ERROR as a reply to QUIT." "ERROR", commands, fail_msg="Did not receive ERROR as a reply to QUIT."
) )