diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-12-05 02:41:46 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-12-05 02:41:46 (GMT) |
commit | 8e9fe9f48941c2a0bcadae6c044b1cfc89229484 (patch) | |
tree | f8e9554f73f0838502c35d582e474479527f2ec3 /Lib/test/test_os.py | |
parent | 2668145dbdd11cc3eef44f0b14adfafb93f9fe0b (diff) | |
download | cpython-8e9fe9f48941c2a0bcadae6c044b1cfc89229484.zip cpython-8e9fe9f48941c2a0bcadae6c044b1cfc89229484.tar.gz cpython-8e9fe9f48941c2a0bcadae6c044b1cfc89229484.tar.bz2 |
Avoid possible zombi process.
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r-- | Lib/test/test_os.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index fc6084b..9cfd7b8 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -1106,13 +1106,15 @@ class Win32KillTests(unittest.TestCase): "win_console_handler.py"), tagname], creationflags=subprocess.CREATE_NEW_PROCESS_GROUP) # Let the interpreter startup before we send signals. See #3137. - count, max = 0, 20 + count, max = 0, 100 while count < max and proc.poll() is None: if m[0] == 1: break - time.sleep(0.5) + time.sleep(0.1) count += 1 else: + # Forcefully kill the process if we weren't able to signal it. + os.kill(proc.pid, signal.SIGINT) self.fail("Subprocess didn't finish initialization") os.kill(proc.pid, event) # proc.send_signal(event) could also be done here. |