[Python-checkins] Fix asyncio flaky tests (GH-7023) (#7024)

Andrew Svetlov webhook-mailer at python.org
Mon May 21 07:47:34 EDT 2018


https://github.com/python/cpython/commit/4d39ade62ac370cf59661a2fa7cd151c76cff087
commit: 4d39ade62ac370cf59661a2fa7cd151c76cff087
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Andrew Svetlov <andrew.svetlov at gmail.com>
date: 2018-05-21T14:47:29+03:00
summary:

Fix asyncio flaky tests (GH-7023) (#7024)

(cherry picked from commit e2537521916c5bf88fcf54d4654ff1bcd332be4a)

Co-authored-by: Andrew Svetlov <andrew.svetlov at gmail.com>

files:
M Lib/test/test_asyncio/test_base_events.py

diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 72c63df91070..a14c55693539 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -1855,9 +1855,10 @@ def prepare(self):
 
         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



More information about the Python-checkins mailing list