From 8aa07d5bc3005516fa31e78029fa994b631f4704 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 28 May 2018 17:45:16 +0200 Subject: [PATCH 1/2] bpo-32458: Increase TLS timeout in test_asyncio test_asyncio: Increase test_start_tls_server_1() client timeout from 5 seconds to 60 seconds, and server timeout from 10 to 120 seconds. The timeout is only used to check if the test hangs, but the 5 seconds limit is commonly reached on slow CIs like Travis CI and some buildbots. --- Lib/test/test_asyncio/test_sslproto.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index c534a341352b00..e24470e77c9cc0 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -248,6 +248,7 @@ async def client(addr): def test_start_tls_server_1(self): HELLO_MSG = b'1' * 1024 * 1024 + TIMEOUT = 60 # seconds server_context = test_utils.simple_server_sslcontext() client_context = test_utils.simple_client_sslcontext() @@ -256,7 +257,7 @@ def test_start_tls_server_1(self): def client(sock, addr): time.sleep(0.5) - sock.settimeout(5) + sock.settimeout(TIMEOUT) sock.connect(addr) data = sock.recv_all(len(HELLO_MSG)) @@ -309,7 +310,7 @@ async def main(): with self.tcp_client(lambda sock: client(sock, addr)): self.loop.run_until_complete( - asyncio.wait_for(main(), loop=self.loop, timeout=10)) + asyncio.wait_for(main(), loop=self.loop, timeout=TIMEOUT * 2)) def test_start_tls_wrong_args(self): async def main(): From 895ed6ba6df8353cafdf4724b5c3e861af33bfa1 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 28 May 2018 17:51:12 +0200 Subject: [PATCH 2/2] Reenable ProactorStartTLSTests --- Lib/test/test_asyncio/test_sslproto.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py index e24470e77c9cc0..821d0d6e657751 100644 --- a/Lib/test/test_asyncio/test_sslproto.py +++ b/Lib/test/test_asyncio/test_sslproto.py @@ -333,7 +333,6 @@ def new_loop(self): @unittest.skipIf(ssl is None, 'No ssl module') @unittest.skipUnless(hasattr(asyncio, 'ProactorEventLoop'), 'Windows only') -@unittest.skipIf(os.environ.get('APPVEYOR'), 'XXX: issue 32458') class ProactorStartTLSTests(BaseStartTLS, unittest.TestCase): def new_loop(self):