All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] runner: Introduce a way to stop testing without marking tests incomplete
@ 2020-12-11 14:07 Petri Latvala
  2020-12-11 15:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Petri Latvala @ 2020-12-11 14:07 UTC (permalink / raw)
  To: igt-dev; +Cc: Tomi Sarvela, Petri Latvala, Chris Wilson

Killing igt_runner with SIGHUP will now still kill the currently
running test, but it will mark that test as being "notrun" instead of
"incomplete". This allows for external tools to interrupt the testing
without messing the results.

Incidentally, Intel CI's testing procedures occasionally falsely
determine that the machine being tested is unreachable and as its next
step, will ssh in and issue a reboot in preparation for the next round
of testing, causing igt_runner to be killed with a SIGHUP...

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Arkadiusz Hiler <arek@hiler.eu>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 runner/executor.c  | 17 +++++++++++++++++
 runner/resultgen.c |  9 ++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index faf272d8..d0eca938 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1054,6 +1054,23 @@ 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
+						 * SIGUP, arrange the
+						 * current test to be
+						 * marked as notrun
+						 * instead of
+						 * incomplete
+						 */
+
+						dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
+							EXECUTOR_EXIT,
+							-SIGHUP, 0.0);
+						if (settings->sync)
+							fdatasync(outputs[_F_JOURNAL]);
+					}
 				}
 
 				aborting = true;
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 3fe83b43..d291cc37 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -17,11 +17,12 @@
 #include "executor.h"
 #include "output_strings.h"
 
-#define INCOMPLETE_EXITCODE -1
+#define INCOMPLETE_EXITCODE -1234
 
 _Static_assert(INCOMPLETE_EXITCODE != IGT_EXIT_SKIP, "exit code clash");
 _Static_assert(INCOMPLETE_EXITCODE != IGT_EXIT_SUCCESS, "exit code clash");
 _Static_assert(INCOMPLETE_EXITCODE != IGT_EXIT_INVALID, "exit code clash");
+_Static_assert(INCOMPLETE_EXITCODE != -SIGHUP, "exit code clash");
 
 struct subtest
 {
@@ -1099,6 +1100,8 @@ static const char *result_from_exitcode(int exitcode)
 		return "abort";
 	case INCOMPLETE_EXITCODE:
 		return "incomplete";
+	case -SIGHUP:
+		return "notrun";
 	default:
 		return "fail";
 	}
@@ -1173,7 +1176,7 @@ static void fill_from_journal(int fd,
 		}
 	}
 
-	if (subtests->size && exitcode == IGT_EXIT_ABORT) {
+	if (subtests->size && (exitcode == IGT_EXIT_ABORT || exitcode == -SIGHUP)) {
 		char *last_subtest = subtests->subs[subtests->size - 1].name;
 		char subtest_piglit_name[256];
 		struct json_object *subtest_obj;
@@ -1181,7 +1184,7 @@ static void fill_from_journal(int fd,
 		generate_piglit_name(entry->binary, last_subtest, subtest_piglit_name, sizeof(subtest_piglit_name));
 		subtest_obj = get_or_create_json_object(tests, subtest_piglit_name);
 
-		set_result(subtest_obj, "abort");
+		set_result(subtest_obj, exitcode == IGT_EXIT_ABORT ? "abort" : "notrun");
 	}
 
 	if (subtests->size == 0) {
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-16 18:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 14:07 [igt-dev] [PATCH i-g-t] runner: Introduce a way to stop testing without marking tests incomplete Petri Latvala
2020-12-11 15:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-12-11 17:58 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-12-16 17:23 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.