mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
[3.13] [tests] test_subprocess maybe avoid a timeout race condition? (GH-133420) (#133421)
[tests] test_subprocess maybe avoid a timeout race condition? (GH-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?
(cherry picked from commit b64aa302d7)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
parent
3d1b8e2a96
commit
e89ca3991c
1 changed files with 2 additions and 2 deletions
|
|
@ -163,13 +163,13 @@ def test_call_timeout(self):
|
|||
|
||||
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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue