diff options
author | Benjamin Berg <bberg@redhat.com> | 2021-07-30 22:36:07 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2021-07-30 23:52:00 +0200 |
commit | 3c8ac241b852effb2e342c36a1ca413bb57c059c (patch) | |
tree | 4dc13c0f07903e84919cddf4f94e3a5a9a6dae4e | |
parent | 2bf6d6a266f3573b76c10597b2c0837a8ccc3574 (diff) |
tests: Try to show backtrace when killed by SIGTERM
This means that we may manage to show a backtrace if meson kills the
test process due to a timeout.
-rw-r--r-- | tests/fprintd.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/fprintd.py b/tests/fprintd.py index 1f8faee..8719e53 100644 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -38,6 +38,7 @@ gi.require_version('FPrint', '2.0') from gi.repository import GLib, Gio, FPrint from output_checker import OutputChecker import cairo +import signal try: from subprocess import DEVNULL @@ -164,6 +165,11 @@ class FPrintdTest(dbusmock.DBusTestCase): @classmethod def setUpClass(cls): + # Try to generate backtrace if meson kills as with SIGTERM + def r(*args): + raise KeyboardInterrupt() + signal.signal(signal.SIGTERM, r) + super().setUpClass() fprintd = None cls._polkitd = None |