summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2023-09-21 07:40:36 -0400
committerHenry Castro <hcastro@collabora.com>2023-09-21 16:01:43 +0200
commitc66683be225ee709095178489ad766d8b18c4040 (patch)
tree377ed14419baf2e51a715942df50c82f735d6c01
parent78039c571ee219e97241942474147d63532d716c (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
-rw-r--r--uitest/libreoffice/connection.py7
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")