summaryrefslogtreecommitdiffstats
path: root/tools/code_coverage
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 00:15:22 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-25 00:15:22 +0000
commit266cd3d6298af7058ba9162c8c5ab9babb5b23bc (patch)
treef829bc2eedbe4387a4588ba096634cfd7d811822 /tools/code_coverage
parente57fb45132e581d3202338fab54791b965676117 (diff)
downloadchromium_src-266cd3d6298af7058ba9162c8c5ab9babb5b23bc.zip
chromium_src-266cd3d6298af7058ba9162c8c5ab9babb5b23bc.tar.gz
chromium_src-266cd3d6298af7058ba9162c8c5ab9babb5b23bc.tar.bz2
Fix process kill and "wait for death" on Windows.
http://build.chromium.org/buildbot/waterfall.fyi/builders/Win%20Coverage%20(dbg)/builds/3420/steps/Run%20Coverage%20Bundles/logs/stdio Review URL: http://codereview.chromium.org/2166007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/code_coverage')
-rwxr-xr-xtools/code_coverage/coverage_posix.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/code_coverage/coverage_posix.py b/tools/code_coverage/coverage_posix.py
index 1d43fa9..47cd524 100755
--- a/tools/code_coverage/coverage_posix.py
+++ b/tools/code_coverage/coverage_posix.py
@@ -131,7 +131,7 @@ def TerminateSignalHandler(sig, stack):
if 'kill' in os.__all__: # POSIX
os.kill(pid, sig)
else:
- subprocess.call(['taskkill.exe', '/PID', pid])
+ subprocess.call(['taskkill.exe', '/PID', str(pid)])
sys.exit(0)
@@ -188,20 +188,21 @@ class RunProgramThread(threading.Thread):
Safe to call even if the process is dead.
"""
if not self._process:
- return self._retcode
+ return self.retcode()
if 'kill' in os.__all__: # POSIX
os.kill(self._process.pid, signal.SIGKILL)
else:
- subprocess.call(['taskkill.exe', '/PID', self._process.pid])
- self._retcode = self._process.wait()
- return self._retcode
+ subprocess.call(['taskkill.exe', '/PID', str(self._process.pid)])
+ return self.retcode()
def retcode(self):
"""Return the return value of the subprocess.
- Kill it if needed.
+ Waits for process to die but does NOT kill it explicitly.
"""
- return self.kill()
+ if self._retcode == None: # must be none, not 0/False
+ self._retcode = self._process.wait()
+ return self._retcode
def RunUntilCompletion(self, timeout):
"""Run thread until completion or timeout (in seconds).