Commit 50a72af6 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

test_ssl: Implement timeout in ssl_io_loop() (#3500)

The timeout parameter was not used.
parent 834a5cec
...@@ -1708,8 +1708,11 @@ class SimpleBackgroundTests(unittest.TestCase): ...@@ -1708,8 +1708,11 @@ class SimpleBackgroundTests(unittest.TestCase):
# A simple IO loop. Call func(*args) depending on the error we get # A simple IO loop. Call func(*args) depending on the error we get
# (WANT_READ or WANT_WRITE) move data between the socket and the BIOs. # (WANT_READ or WANT_WRITE) move data between the socket and the BIOs.
timeout = kwargs.get('timeout', 10) timeout = kwargs.get('timeout', 10)
deadline = time.monotonic() + timeout
count = 0 count = 0
while True: while True:
if time.monotonic() > deadline:
self.fail("timeout")
errno = None errno = None
count += 1 count += 1
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment