]> granicus.if.org Git - python/commitdiff
Fix asyncio flaky tests (#7023)
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Mon, 21 May 2018 09:03:45 +0000 (12:03 +0300)
committerGitHub <noreply@github.com>
Mon, 21 May 2018 09:03:45 +0000 (12:03 +0300)
Lib/test/test_asyncio/test_base_events.py

index 72c63df91070dc9288fbf44dbf5148969fc926e4..a14c5569353974a487eaabb3e461c8f7df7db019 100644 (file)
@@ -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