[Python-checkins] bpo-32458: Further tune start_tls tests (GH-7166)

Miss Islington (bot) webhook-mailer at python.org
Mon May 28 16:44:17 EDT 2018


https://github.com/python/cpython/commit/4b828467a3fcec0c1947e8326f67b8db12a4f303
commit: 4b828467a3fcec0c1947e8326f67b8db12a4f303
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-05-28T13:44:12-07:00
summary:

bpo-32458: Further tune start_tls tests (GH-7166)

(cherry picked from commit 8267ea2e84d355f00654dec3ad782fc7b1f680f1)

Co-authored-by: Yury Selivanov <yury at magic.io>

files:
M Lib/test/test_asyncio/test_sslproto.py

diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
index 932487a9e3c6..1b2f9d2a3a2a 100644
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -293,7 +293,7 @@ def eof_received(self):
 
             new_tr.close()
 
-        with self.tcp_server(serve) as srv:
+        with self.tcp_server(serve, timeout=self.TIMEOUT) as srv:
             self.loop.run_until_complete(
                 asyncio.wait_for(client(srv.addr), loop=self.loop, timeout=10))
 
@@ -358,7 +358,7 @@ def eof_received(self):
 
             new_tr.close()
 
-        with self.tcp_server(serve) as srv:
+        with self.tcp_server(serve, timeout=self.TIMEOUT) as srv:
             self.loop.run_until_complete(
                 asyncio.wait_for(client(srv.addr),
                                  loop=self.loop, timeout=self.TIMEOUT))
@@ -412,7 +412,8 @@ def connection_lost(self, exc):
 
             new_tr = await self.loop.start_tls(
                 tr, proto, server_context,
-                server_side=True)
+                server_side=True,
+                ssl_handshake_timeout=self.TIMEOUT)
 
             await on_eof
             await on_con_lost
@@ -429,7 +430,8 @@ def connection_lost(self, exc):
                 lambda: proto, '127.0.0.1', 0)
             addr = server.sockets[0].getsockname()
 
-            with self.tcp_client(lambda sock: client(sock, addr)):
+            with self.tcp_client(lambda sock: client(sock, addr),
+                                 timeout=self.TIMEOUT):
                 await asyncio.wait_for(
                     main(proto, on_con, on_eof, on_con_lost),
                     loop=self.loop, timeout=self.TIMEOUT)



More information about the Python-checkins mailing list