From 1172c5546b2d0e579f254347578085339467c30f Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 11 Sep 2017 17:09:57 +0200 Subject: [PATCH] test_ssl: Implement timeout in ssl_io_loop() The timeout parameter was not used. --- Lib/test/test_ssl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 99fd80b3a04245..523322da2f60ed 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -1708,8 +1708,11 @@ def ssl_io_loop(self, sock, incoming, outgoing, func, *args, **kwargs): # 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: