]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38614: Use test.support.LONG_TIMEOUT constant (GH-17562)
authorVictor Stinner <vstinner@python.org>
Tue, 10 Dec 2019 20:12:26 +0000 (21:12 +0100)
committerGitHub <noreply@github.com>
Tue, 10 Dec 2019 20:12:26 +0000 (21:12 +0100)
Replace hardcoded timeout constants in tests with LONG_TIMEOUT of
test.support, so it's easier to ajdust this timeout for all tests at
once.

LONG_TIMEOUT is 5 minutes by default, but it can be longer depending
on --timeout command line option.

Lib/test/_test_multiprocessing.py
Lib/test/test_asyncio/test_sslproto.py
Lib/test/test_logging.py

index 611291cbbaf93bfb192cc94d949f2eb7d5b02dc2..86f3d1ca3a36a6f8bf04e286508097c6f38d0bf1 100644 (file)
@@ -295,7 +295,7 @@ class _TestProcess(BaseTestCase):
             target=self._test_create_grandchild_process, args=(wconn, ))
         p.start()
 
-        if not rconn.poll(timeout=60):
+        if not rconn.poll(timeout=support.LONG_TIMEOUT):
             raise AssertionError("Could not communicate with child process")
         parent_process_status = rconn.recv()
         self.assertEqual(parent_process_status, "alive")
@@ -303,7 +303,7 @@ class _TestProcess(BaseTestCase):
         p.terminate()
         p.join()
 
-        if not rconn.poll(timeout=60):
+        if not rconn.poll(timeout=support.LONG_TIMEOUT):
             raise AssertionError("Could not communicate with child process")
         parent_process_status = rconn.recv()
         self.assertEqual(parent_process_status, "not alive")
index 7ba3d7361ad8a4098a9a54be74960fe3b87e93e1..8e9d4c5194f6f56e658af0207a09b0262d855e1d 100644 (file)
@@ -16,6 +16,7 @@ import asyncio
 from asyncio import log
 from asyncio import protocols
 from asyncio import sslproto
+from test import support
 from test.test_asyncio import utils as test_utils
 from test.test_asyncio import functional as func_tests
 
@@ -163,7 +164,7 @@ class SslProtoHandshakeTests(test_utils.TestCase):
 class BaseStartTLS(func_tests.FunctionalTestCaseMixin):
 
     PAYLOAD_SIZE = 1024 * 100
-    TIMEOUT = 60
+    TIMEOUT = support.LONG_TIMEOUT
 
     def new_loop(self):
         raise NotImplementedError
index 3b135b8ddf966a8a40163a57fa7ce9c50fe15ec5..4feed03fec2a814c6d7bff573e4d6c11be04a19a 100644 (file)
@@ -1059,8 +1059,8 @@ if hasattr(socket, "AF_UNIX"):
 # - end of server_helper section
 
 class SMTPHandlerTest(BaseTest):
-    # bpo-14314, bpo-19665, bpo-34092: don't wait forever, timeout of 1 minute
-    TIMEOUT = 60.0
+    # bpo-14314, bpo-19665, bpo-34092: don't wait forever
+    TIMEOUT = support.LONG_TIMEOUT
 
     def test_basic(self):
         sockmap = {}