mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
[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?
This commit is contained in:
parent
78adb63ee1
commit
b64aa302d7
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue