Commit d533da3a authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[test] Be more verbose when killing hanging tests

TBR=tmrts@chromium.org

Bug: v8:9145,v8:9098
Change-Id: Ib2170819f6d9aa00174fefb6bef4b0a27c11acfc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1578503Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarSergiy Belozorov <sergiyb@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60956}
parent d5f0178a
...@@ -129,8 +129,12 @@ class BaseCommand(object): ...@@ -129,8 +129,12 @@ class BaseCommand(object):
def _abort(self, process, abort_called): def _abort(self, process, abort_called):
abort_called[0] = True abort_called[0] = True
try: try:
print('Attempting to kill process %s' % process.pid)
sys.stdout.flush()
self._kill_process(process) self._kill_process(process)
except OSError: except OSError as e:
print(e)
sys.stdout.flush()
pass pass
def __str__(self): def __str__(self):
...@@ -207,9 +211,6 @@ class WindowsCommand(BaseCommand): ...@@ -207,9 +211,6 @@ class WindowsCommand(BaseCommand):
return subprocess.list2cmdline(self._to_args_list()) return subprocess.list2cmdline(self._to_args_list())
def _kill_process(self, process): def _kill_process(self, process):
if self.verbose:
print('Attempting to kill process %d' % process.pid)
sys.stdout.flush()
tk = subprocess.Popen( tk = subprocess.Popen(
'taskkill /T /F /PID %d' % process.pid, 'taskkill /T /F /PID %d' % process.pid,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
......
...@@ -136,8 +136,9 @@ class VerboseProgressIndicator(SimpleProgressIndicator): ...@@ -136,8 +136,9 @@ class VerboseProgressIndicator(SimpleProgressIndicator):
output = subprocess.check_output(cmd, shell=True) output = subprocess.check_output(cmd, shell=True)
self._print('List of processes:') self._print('List of processes:')
for line in (output or '').splitlines(): for line in (output or '').splitlines():
# Show only command with process info cut off. # Show command with pid, but other process info cut off.
self._print(line[line.index(OUT_DIR):]) self._print('pid: %s cmd: %s' %
(line.split()[1], line[line.index(OUT_DIR):]))
except: except:
pass pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment