[pypy-svn] pypy default: Quit the "timeout killer" thread as soon as the process exits.

amauryfa commits-noreply at bitbucket.org
Mon Feb 14 19:14:31 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r41921:657d5ff5412b
Date: 2011-02-14 19:14 +0100
http://bitbucket.org/pypy/pypy/changeset/657d5ff5412b/

Log:	Quit the "timeout killer" thread as soon as the process exits.
	Otherwise it may stay too long and other tests will count it among
	the active threads...

diff --git a/pypy/module/thread/test/support.py b/pypy/module/thread/test/support.py
--- a/pypy/module/thread/test/support.py
+++ b/pypy/module/thread/test/support.py
@@ -22,7 +22,9 @@
 
 def timeout_killer(pid, delay):
     def kill():
-        time.sleep(delay)
+        for x in range(delay * 10):
+            time.sleep(0.1)
+            os.kill(pid, 0)
         os.kill(pid, 9)
         print "process %s killed!" % (pid,)
     thread.start_new_thread(kill, ())


More information about the Pypy-commit mailing list