Skip to content

Commit 8267ea2

Browse files
authored
bpo-32458: Further tune start_tls tests (#7166)
1 parent e97ba4c commit 8267ea2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Lib/test/test_asyncio/test_sslproto.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ async def client(addr):
293293

294294
new_tr.close()
295295

296-
with self.tcp_server(serve) as srv:
296+
with self.tcp_server(serve, timeout=self.TIMEOUT) as srv:
297297
self.loop.run_until_complete(
298298
asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10))
299299

@@ -358,7 +358,7 @@ async def client(addr):
358358

359359
new_tr.close()
360360

361-
with self.tcp_server(serve) as srv:
361+
with self.tcp_server(serve, timeout=self.TIMEOUT) as srv:
362362
self.loop.run_until_complete(
363363
asyncio.wait_for(client(srv.addr),
364364
loop=self.loop, timeout=self.TIMEOUT))
@@ -412,7 +412,8 @@ async def main(proto, on_con, on_eof, on_con_lost):
412412

413413
new_tr = await self.loop.start_tls(
414414
tr, proto, server_context,
415-
server_side=True)
415+
server_side=True,
416+
ssl_handshake_timeout=self.TIMEOUT)
416417

417418
await on_eof
418419
await on_con_lost
@@ -429,7 +430,8 @@ async def run_main():
429430
lambda: proto, '127.0.0.1', 0)
430431
addr = server.sockets[0].getsockname()
431432

432-
with self.tcp_client(lambda sock: client(sock, addr)):
433+
with self.tcp_client(lambda sock: client(sock, addr),
434+
timeout=self.TIMEOUT):
433435
await asyncio.wait_for(
434436
main(proto, on_con, on_eof, on_con_lost),
435437
loop=self.loop, timeout=self.TIMEOUT)

0 commit comments

Comments
 (0)