[igt-dev] [PATCH i-g-t] runner: Handle graceful exit regardless of log level

Petri Latvala petri.latvala at intel.com
Mon Feb 8 10:24:39 UTC 2021


The SIGHUP handling was incorrectly done only when log level was at
least 'normal'.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
Cc: Arkadiusz Hiler <arek at hiler.eu>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 runner/executor.c | 52 ++++++++++++++++++++++-------------------------
 1 file changed, 24 insertions(+), 28 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 3ca2d20a..9b582179 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1008,37 +1008,33 @@ static int monitor_output(pid_t child,
 					     get_cmdline(siginfo.ssi_pid, comm, sizeof(comm)),
 					     siginfo.ssi_pid,
 					     strsignal(siginfo.ssi_signo));
+				}
 
-					if (siginfo.ssi_signo == SIGHUP) {
-						/*
-						 * If taken down with
-						 * SIGHUP, arrange the
-						 * current test to be
-						 * marked as notrun
-						 * instead of
-						 * incomplete. For
-						 * other signals we
-						 * don't need to do
-						 * anything, the lack
-						 * of a completion
-						 * marker of any kind
-						 * in the logs will
-						 * mark those tests as
-						 * incomplete. Note
-						 * that since we set
-						 * 'aborting' to true
-						 * we're going to skip
-						 * all other journal
-						 * writes later.
-						 */
+				if (siginfo.ssi_signo == SIGHUP) {
+					/*
+					 * If taken down with SIGHUP,
+					 * arrange the current test to
+					 * be marked as notrun instead
+					 * of incomplete. For other
+					 * signals we don't need to do
+					 * anything, the lack of a
+					 * completion marker of any
+					 * kind in the logs will mark
+					 * those tests as
+					 * incomplete. Note that since
+					 * we set 'aborting' to true
+					 * we're going to skip all
+					 * other journal writes later.
+					 */
 
+					if (settings->log_level >= LOG_LEVEL_NORMAL)
 						outf("Exiting gracefully, currently running test will have a 'notrun' result\n");
-						dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
-							EXECUTOR_EXIT,
-							-SIGHUP, 0.0);
-						if (settings->sync)
-							fdatasync(outputs[_F_JOURNAL]);
-					}
+
+					dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
+						EXECUTOR_EXIT,
+						-SIGHUP, 0.0);
+					if (settings->sync)
+						fdatasync(outputs[_F_JOURNAL]);
 				}
 
 				aborting = true;
-- 
2.29.2



More information about the igt-dev mailing list