From e2537521916c5bf88fcf54d4654ff1bcd332be4a Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Mon, 21 May 2018 12:03:45 +0300 Subject: [PATCH] Fix asyncio flaky tests (#7023) --- Lib/test/test_asyncio/test_base_events.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 2.40.0