Skip to content

Commit 50a72af

Browse files
authored
test_ssl: Implement timeout in ssl_io_loop() (#3500)
The timeout parameter was not used.
1 parent 834a5ce commit 50a72af

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_ssl.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,8 +1708,11 @@ def ssl_io_loop(self, sock, incoming, outgoing, func, *args, **kwargs):
17081708
# A simple IO loop. Call func(*args) depending on the error we get
17091709
# (WANT_READ or WANT_WRITE) move data between the socket and the BIOs.
17101710
timeout = kwargs.get('timeout', 10)
1711+
deadline = time.monotonic() + timeout
17111712
count = 0
17121713
while True:
1714+
if time.monotonic() > deadline:
1715+
self.fail("timeout")
17131716
errno = None
17141717
count += 1
17151718
try:

0 commit comments

Comments
 (0)