[Python-checkins] bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)

vstinner webhook-mailer at python.org
Mon Jun 21 19:58:28 EDT 2021


https://github.com/python/cpython/commit/be1cb3214d09d4bf0288bc45f3c1f167f67e4514
commit: be1cb3214d09d4bf0288bc45f3c1f167f67e4514
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2021-06-22T01:58:19+02:00
summary:

bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)

Fix asyncio test_popen() of test_windows_utils by using a longer
timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT
timeout rather than a hardcoded timeout of 10 seconds: it's 30
seconds by default, but it is made longer on slow buildbots.

WaitForMultipleObjects() timeout argument is in milliseconds.

files:
A Misc/NEWS.d/next/Tests/2021-06-21-17-53-41.bpo-44287.YON57s.rst
M Lib/test/test_asyncio/test_windows_utils.py

diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py
index 45c09bb4a2d3a0..eafa5be3829682 100644
--- a/Lib/test/test_asyncio/test_windows_utils.py
+++ b/Lib/test/test_asyncio/test_windows_utils.py
@@ -107,7 +107,8 @@ def test_popen(self):
 
         events = [ovin.event, ovout.event, overr.event]
         # Super-long timeout for slow buildbots.
-        res = _winapi.WaitForMultipleObjects(events, True, 10000)
+        res = _winapi.WaitForMultipleObjects(events, True,
+                                             int(support.SHORT_TIMEOUT * 1000))
         self.assertEqual(res, _winapi.WAIT_OBJECT_0)
         self.assertFalse(ovout.pending)
         self.assertFalse(overr.pending)
diff --git a/Misc/NEWS.d/next/Tests/2021-06-21-17-53-41.bpo-44287.YON57s.rst b/Misc/NEWS.d/next/Tests/2021-06-21-17-53-41.bpo-44287.YON57s.rst
new file mode 100644
index 00000000000000..66b3afe139aa8d
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2021-06-21-17-53-41.bpo-44287.YON57s.rst
@@ -0,0 +1,4 @@
+Fix asyncio test_popen() of test_windows_utils by using a longer timeout.
+Use military grade battle-tested :data:`test.support.SHORT_TIMEOUT` timeout
+rather than a hardcoded timeout of 10 seconds: it's 30 seconds by default, but
+it is made longer on slow buildbots. Patch by Victor Stinner.



More information about the Python-checkins mailing list