diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-06 21:43:02 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-06 21:43:02 (GMT) |
commit | 149b1c779781f5688caa746ea9e9f7eed8d44bee (patch) | |
tree | 165dc42e73cd9044dc9ae8f3327663da47c306ef /Lib/test/test_subprocess.py | |
parent | 368f34bb4b877495ecb574cb9f17fe330b338cff (diff) | |
download | cpython-149b1c779781f5688caa746ea9e9f7eed8d44bee.zip cpython-149b1c779781f5688caa746ea9e9f7eed8d44bee.tar.gz cpython-149b1c779781f5688caa746ea9e9f7eed8d44bee.tar.bz2 |
Use a sleep for test_subprocess timeout test
instead of an active loop (while True: pass) to limit race conditions.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 7d4ca2c..b52d8e8 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -127,9 +127,10 @@ class ProcessTestCase(BaseTestCase): with self.assertRaises(subprocess.TimeoutExpired) as c: output = subprocess.check_output( [sys.executable, "-c", - "import sys; sys.stdout.write('BDFL')\n" + "import sys, time\n" + "sys.stdout.write('BDFL')\n" "sys.stdout.flush()\n" - "while True: pass"], + "time.sleep(3600)"], # Some heavily loaded buildbots (sparc Debian 3.x) require # this much time to start and print. timeout=3) |