test framework: ignore sighups
On OS X, we're occasionally seeing sighups come in to what
looks like the whole test runner process group (all the
multiprocessing workers and the main process). It's not due
to a lost console. This change has the main parallel test runner
process and the child worker processes ignore sighup.
Covers:
https://llvm.org/bugs/show_bug.cgi?id=24846
llvm-svn: 248141
diff --git a/lldb/test/dosep.py b/lldb/test/dosep.py
index a8bb7a3..639e8f7 100755
--- a/lldb/test/dosep.py
+++ b/lldb/test/dosep.py
@@ -83,6 +83,7 @@
for the given thread/process calling it. Returns a 0-based index."""
GET_WORKER_INDEX = None
+
def setup_global_variables(
lock, counter, total, name_len, options, worker_index_map):
global output_lock, test_counter, total_tests, test_name_len
@@ -277,6 +278,7 @@
# Shut off interrupt handling in the child process.
signal.signal(signal.SIGINT, signal.SIG_IGN)
+ signal.signal(signal.SIGHUP, signal.SIG_IGN)
# Setup the global state for the worker process.
setup_global_variables(
@@ -1164,6 +1166,9 @@
test runner, which will forward them on to results_formatter.
"""
+ # Do not shut down on sighup.
+ signal.signal(signal.SIGHUP, signal.SIG_IGN)
+
dotest_argv = sys.argv[1:]
global output_on_success, RESULTS_FORMATTER, output_lock