[test] Print more details when terminating hanging tests

This prints the same details about a process when attempting to kill it
as when termination fails with an exception. This will make it
easier to correlate the two and to see which might be hanging.

Bug: v8:8292
Change-Id: I4b6a50386d4e9d84ded55cf262f19529138654a9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2006092
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65837}
This commit is contained in:
Michael Achenbach 2020-01-17 10:37:36 +01:00 committed by Commit Bot
parent 1adb076c07
commit 16a0411057

View File

@ -134,16 +134,16 @@ class BaseCommand(object):
def _abort(self, process, abort_called):
abort_called[0] = True
started_as = self.to_string(relative=True)
process_text = 'process %d started as:\n %s\n' % (process.pid, started_as)
try:
print('Attempting to kill process %s' % process.pid)
print('Attempting to kill ' + process_text)
sys.stdout.flush()
self._kill_process(process)
except OSError as e:
print(e)
started_as = self.to_string(relative=True)
print("Unruly process started as:\n %s\n" % started_as)
print('Unruly ' + process_text)
sys.stdout.flush()
pass
def __str__(self):
return self.to_string()