bpo-38614: Use test.support.LONG_TIMEOUT constant (GH-17562)

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.
This commit is contained in:
Victor Stinner 2019-12-10 21:12:26 +01:00 committed by GitHub
parent bbc8b7965b
commit c98b0199a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View 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")