[Python-checkins] r87071 - python/branches/py3k/Lib/test/test_os.py

hirokazu.yamamoto python-checkins at python.org
Sun Dec 5 03:41:52 CET 2010


Author: hirokazu.yamamoto
Date: Sun Dec  5 03:41:46 2010
New Revision: 87071

Log:
Avoid possible zombi process.


Modified:
   python/branches/py3k/Lib/test/test_os.py

Modified: python/branches/py3k/Lib/test/test_os.py
==============================================================================
--- python/branches/py3k/Lib/test/test_os.py	(original)
+++ python/branches/py3k/Lib/test/test_os.py	Sun Dec  5 03:41:46 2010
@@ -1106,13 +1106,15 @@
                                 "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.


More information about the Python-checkins mailing list