]> granicus.if.org Git - python/commitdiff
test_ssl: Implement timeout in ssl_io_loop() (#3500)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 11 Sep 2017 16:34:24 +0000 (09:34 -0700)
committerGitHub <noreply@github.com>
Mon, 11 Sep 2017 16:34:24 +0000 (09:34 -0700)
The timeout parameter was not used.

Lib/test/test_ssl.py

index 99fd80b3a0424512c6bee24d37b543f86df4e11d..523322da2f60ed4bebe6d9f79cd8fba08e3c179e 100644 (file)
@@ -1708,8 +1708,11 @@ class SimpleBackgroundTests(unittest.TestCase):
         # 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.
         timeout = kwargs.get('timeout', 10)
+        deadline = time.monotonic() + timeout
         count = 0
         while True:
+            if time.monotonic() > deadline:
+                self.fail("timeout")
             errno = None
             count += 1
             try: