]> granicus.if.org Git - python/commitdiff
bpo-32458: Further tune start_tls tests (#7166)
authorYury Selivanov <yury@magic.io>
Mon, 28 May 2018 19:48:59 +0000 (15:48 -0400)
committerGitHub <noreply@github.com>
Mon, 28 May 2018 19:48:59 +0000 (15:48 -0400)
Lib/test/test_asyncio/test_sslproto.py

index 932487a9e3c639127a54956ab25324263f824af7..1b2f9d2a3a2a13c76335e6f9f21946115c19b7c0 100644 (file)
@@ -293,7 +293,7 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin):
 
             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 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin):
 
             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 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin):
 
             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 @@ class BaseStartTLS(func_tests.FunctionalTestCaseMixin):
                 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)