From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 21 May 2018 11:47:29 +0000 (-0700) Subject: Fix asyncio flaky tests (GH-7023) (#7024) X-Git-Tag: v3.7.0b5~68 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4d39ade62ac370cf59661a2fa7cd151c76cff087;p=python Fix asyncio flaky tests (GH-7023) (#7024) (cherry picked from commit e2537521916c5bf88fcf54d4654ff1bcd332be4a) Co-authored-by: Andrew Svetlov --- diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 72c63df910..a14c556935 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -1855,9 +1855,10 @@ class BaseLoopSockSendfileTests(test_utils.TestCase): for _ in range(10): try: - self.run_loop(self.loop.sock_connect(sock, (support.HOST, port))) + self.run_loop(self.loop.sock_connect(sock, + (support.HOST, port))) except OSError: - time.sleep(0.5) + self.run_loop(asyncio.sleep(0.5)) continue else: break