summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2025-05-05 04:02:16 (GMT)
committerGitHub <noreply@github.com>2025-05-05 04:02:16 (GMT)
commitb64aa302d7bc09454ba8d5b19922ff6a4192dd96 (patch)
treece8ceb6d0838b6fdeb45bff4f12fa57432e72b08
parent78adb63ee198c94c6ce2a1634aa7ea1d47c011ad (diff)
downloadcpython-b64aa302d7bc09454ba8d5b19922ff6a4192dd96.zip
cpython-b64aa302d7bc09454ba8d5b19922ff6a4192dd96.tar.gz
cpython-b64aa302d7bc09454ba8d5b19922ff6a4192dd96.tar.bz2
[tests] test_subprocess maybe avoid a timeout race condition? (#133420)
The few buildbot failures on https://github.com/python/cpython/pull/133103 are possibly just due to racing a child process launch and exit?
-rw-r--r--Lib/test/test_subprocess.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index d2db8fb..ca35804 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -164,13 +164,13 @@ class ProcessTestCase(BaseTestCase):
def test_timeout_exception(self):
try:
- subprocess.run(['echo', 'hi'], timeout = -1)
+ subprocess.run([sys.executable, '-c', 'import time;time.sleep(9)'], timeout = -1)
except subprocess.TimeoutExpired as e:
self.assertIn("-1 seconds", str(e))
else:
self.fail("Expected TimeoutExpired exception not raised")
try:
- subprocess.run(['echo', 'hi'], timeout = 0)
+ subprocess.run([sys.executable, '-c', 'import time;time.sleep(9)'], timeout = 0)
except subprocess.TimeoutExpired as e:
self.assertIn("0 seconds", str(e))
else: