Skip to content

Commit

Permalink
Another set of fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
1st1 committed Jan 26, 2018
1 parent f4b5714 commit a1ae2a7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Lib/test/test_asyncio/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import threading
import unittest

from test import support
from test.test_asyncio import utils as test_utils
from test.test_asyncio import functional as func_tests

Expand All @@ -17,7 +18,13 @@ def test_start_server_1(self):
HELLO_MSG = b'1' * 1024 * 5 + b'\n'

def client(sock, addr):
time.sleep(0.2)
for i in range(10):
time.sleep(0.2)
if srv.is_serving():
break
else:
raise RuntimeError

sock.settimeout(2)
sock.connect(addr)
sock.send(HELLO_MSG)
Expand All @@ -36,7 +43,7 @@ async def main(srv):
await srv.serve_forever()

srv = self.loop.run_until_complete(asyncio.start_server(
serve, '0.0.0.0', 0, loop=self.loop, start_serving=False))
serve, support.HOSTv4, 0, loop=self.loop, start_serving=False))

self.assertFalse(srv.is_serving())

Expand Down

0 comments on commit a1ae2a7

Please sign in to comment.