[test] Dump traceback on test-runner interrupts

Bug: v8:13113
Change-Id: I7cd37446d9ecbe271e0e5df96a4dcfd43b307c27
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3879489
Reviewed-by: Alexander Schulze <alexschulze@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83056}
This commit is contained in:
Michael Achenbach 2022-09-08 09:24:48 +02:00 committed by V8 LUCI CQ
parent f1026c1917
commit 3c4654da69
2 changed files with 8 additions and 0 deletions

View File

@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import faulthandler
import logging
import signal
@ -20,11 +21,15 @@ class SignalProc(base.TestProcObserver):
logging.warning('Ctrl-C detected, early abort...')
self.exit_code = utils.EXIT_CODE_INTERRUPTED
self.stop()
if logging.getLogger().isEnabledFor(logging.INFO):
faulthandler.dump_traceback()
def _on_sigterm(self, _signum, _stack_frame):
logging.warning('SIGTERM received, early abort...')
self.exit_code = utils.EXIT_CODE_TERMINATED
self.stop()
if logging.getLogger().isEnabledFor(logging.INFO):
faulthandler.dump_traceback()
def worst_exit_code(self, results):
exit_code = results.exit_code()

View File

@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import faulthandler
import logging
import time
@ -34,3 +35,5 @@ class TimeoutProc(base.TestProcObserver):
if time.time() - self._start > self._duration_sec:
logging.info('Total timeout reached.')
self.stop()
if logging.getLogger().isEnabledFor(logging.INFO):
faulthandler.dump_traceback()