From 6b6017b40c23d9ed28fb96075f27250280c2b7f4 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 26 Jun 2022 16:37:47 +0200 Subject: [PATCH] testStarNick: Replace unreliable workaround for irc2 --- irctest/server_tests/regressions.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/irctest/server_tests/regressions.py b/irctest/server_tests/regressions.py index bf9145c..1f11ff5 100644 --- a/irctest/server_tests/regressions.py +++ b/irctest/server_tests/regressions.py @@ -2,10 +2,13 @@ Regression tests for bugs in `Ergo `_. """ -import time - from irctest import cases, runner -from irctest.numerics import ERR_ERRONEUSNICKNAME, ERR_NICKNAMEINUSE, RPL_WELCOME +from irctest.numerics import ( + ERR_ERRONEUSNICKNAME, + ERR_NICKNAMEINUSE, + RPL_HELLO, + RPL_WELCOME, +) from irctest.patma import ANYDICT @@ -111,8 +114,7 @@ class RegressionsTestCase(cases.BaseServerTestCase): self.sendLine(1, "NICK *") self.sendLine(1, "USER u s e r") replies = {"NOTICE"} - time.sleep(2) # give time to slow servers, like irc2 to reply - while replies == {"NOTICE"}: + while replies <= {"NOTICE", RPL_HELLO}: replies = set(msg.command for msg in self.getMessages(1, synchronize=False)) self.assertIn(ERR_ERRONEUSNICKNAME, replies) self.assertNotIn(RPL_WELCOME, replies)