From 54987100b2e74ff836c94df98e1f57dc43005172 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 27 Jul 2019 10:34:18 +0000 Subject: [PATCH] [stream-refactor] allow up to 30 seconds to connect in unix_test It reliably fails when running on a (intentionally) heavily loaded machine --- tests/unix_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/unix_test.py b/tests/unix_test.py index 4f4aab8a..cb8c08f5 100644 --- a/tests/unix_test.py +++ b/tests/unix_test.py @@ -86,11 +86,12 @@ class ClientTest(testlib.TestCase): def _try_connect(self, path): # give server a chance to setup listener - for x in range(10): + timeout = time.time() + 30.0 + while True: try: return mitogen.unix.connect(path) except socket.error: - if x == 9: + if time.time() > timeout: raise time.sleep(0.1)