summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-09-11 16:34:24 (GMT)
committerGitHub <noreply@github.com>2017-09-11 16:34:24 (GMT)
commit50a72af6574f30090cd496c2f74906a52337865f (patch)
treecc72eae564ca2f344df4eb566d52a6a59cc8eeae /Lib/test/test_ssl.py
parent834a5cecac0e77e907762611c06fa460545487e7 (diff)
downloadcpython-50a72af6574f30090cd496c2f74906a52337865f.zip
cpython-50a72af6574f30090cd496c2f74906a52337865f.tar.gz
cpython-50a72af6574f30090cd496c2f74906a52337865f.tar.bz2
test_ssl: Implement timeout in ssl_io_loop() (#3500)
The timeout parameter was not used.
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 99fd80b..523322d 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -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: