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
This commit is contained in:
Todd Fiala 2015-09-21 05:42:26 +00:00
parent 0013be16ff
commit 1cc97b4399

View File

@ -83,6 +83,7 @@ RESULTS_LISTENER_CHANNEL = None
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 @@ def process_dir_worker_multiprocessing(
# 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 @@ def main(print_details_on_success, num_threads, test_subdir,
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