diff options
author | Henry Castro <hcastro@collabora.com> | 2023-09-21 07:40:36 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2023-10-04 15:51:10 +0200 |
commit | 0d21e1075f0288a007cb427ce508d6fbbf8503dd (patch) | |
tree | f48457475b1eae93340990e5e5b374b7c182b0cf /uitest/libreoffice | |
parent | a3935f1a09405a56f13f661797f64ecd31e095f7 (diff) |
uitest: add signal_handler function
install signal handler to analyze if the
soffice bootstrap has some issues.
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I8b05b9c24bf531f4162554433180d80526cb2983
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157518
Tested-by: Jenkins
Diffstat (limited to 'uitest/libreoffice')
-rw-r--r-- | uitest/libreoffice/connection.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py index 40c4757406ab..101a5385fd4a 100644 --- a/uitest/libreoffice/connection.py +++ b/uitest/libreoffice/connection.py @@ -10,6 +10,7 @@ import time import traceback import uuid import os +import signal try: import pyuno @@ -20,6 +21,9 @@ except ImportError: print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") raise +def signal_handler(signal_num, frame): + signal_name = signal.Signals(signal_num).name + print(f'Signal handler called with signal {signal_name} ({signal_num})', flush=True) class OfficeConnection: def __init__(self, args): @@ -33,6 +37,9 @@ class OfficeConnection: If the connection method is path the instance will be created as a new subprocess. If the connection method is connect the instance tries to connect to an existing instance with the specified socket string """ + signal.signal(signal.SIGCHLD, signal_handler) + signal.signal(signal.SIGPIPE, signal_handler) + (method, sep, rest) = self.args["--soffice"].partition(":") if sep != ":": raise Exception("soffice parameter does not specify method") |