Skip to content

Commit 4d39ade

Browse files
Fix asyncio flaky tests (GH-7023) (#7024)
(cherry picked from commit e253752) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
1 parent b8b8000 commit 4d39ade

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/test/test_asyncio/test_base_events.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,9 +1855,10 @@ def prepare(self):
18551855

18561856
for _ in range(10):
18571857
try:
1858-
self.run_loop(self.loop.sock_connect(sock, (support.HOST, port)))
1858+
self.run_loop(self.loop.sock_connect(sock,
1859+
(support.HOST, port)))
18591860
except OSError:
1860-
time.sleep(0.5)
1861+
self.run_loop(asyncio.sleep(0.5))
18611862
continue
18621863
else:
18631864
break

0 commit comments

Comments
 (0)