bpo-38614: Use support timeout constants (GH-17572)

This commit is contained in:
Victor Stinner 2019-12-11 22:17:04 +01:00 committed by GitHub
parent 0d63bacefd
commit 7772b1af5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 36 deletions

View file

@ -1144,7 +1144,7 @@ class _TestQueue(BaseTestCase):
q = self.Queue()
q.put(NotSerializable())
q.put(True)
self.assertTrue(q.get(timeout=support.LONG_TIMEOUT))
self.assertTrue(q.get(timeout=support.SHORT_TIMEOUT))
close_queue(q)
with test.support.captured_stderr():
@ -1159,8 +1159,7 @@ class _TestQueue(BaseTestCase):
# qsize is not available on all platform as it
# relies on sem_getvalue
pass
# bpo-30595: use a timeout of 1 second for slow buildbots
self.assertTrue(q.get(timeout=1.0))
self.assertTrue(q.get(timeout=support.SHORT_TIMEOUT))
# Check that the size of the queue is correct
self.assertTrue(q.empty())
close_queue(q)
@ -1197,7 +1196,7 @@ class _TestQueue(BaseTestCase):
# Verify that q is still functioning correctly
q.put(True)
self.assertTrue(q.get(timeout=1.0))
self.assertTrue(q.get(timeout=support.SHORT_TIMEOUT))
# Assert that the serialization and the hook have been called correctly
self.assertTrue(not_serializable_obj.reduce_was_called)