Fix asyncio flaky tests (#7023)

This commit is contained in:
Andrew Svetlov 2018-05-21 12:03:45 +03:00 committed by GitHub
parent a84d0b361a
commit e253752191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View 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