summaryrefslogtreecommitdiff
path: root/runner/resultgen.c
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2021-01-21 11:50:14 +0200
committerPetri Latvala <petri.latvala@intel.com>2021-01-22 11:10:12 +0200
commit10c83dfa5ad2c3c8838e259842809e96920a1d69 (patch)
treedb488be98415e0846135b9845ea918eba91b1746 /runner/resultgen.c
parent22e3daaed82ab7890018a2f2aabf5082cd536023 (diff)
runner: Introduce a way to stop testing without marking tests incomplete
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... v2: - Fix typo SIGUP -> SIGHUP - Make runner print that a graceful exit will be done - Explain the code flow regarding handling of signals to the runner process - Use GRACEFUL_EXITCODE instead of -SIGHUP directly 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'runner/resultgen.c')
-rw-r--r--runner/resultgen.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/runner/resultgen.c b/runner/resultgen.c
index 46007803..8d0c6249 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -17,11 +17,13 @@
#include "executor.h"
#include "output_strings.h"
-#define INCOMPLETE_EXITCODE -1
+#define INCOMPLETE_EXITCODE -1234
+#define GRACEFUL_EXITCODE -SIGHUP
_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 != GRACEFUL_EXITCODE, "exit code clash");
struct subtest
{
@@ -1106,6 +1108,8 @@ static const char *result_from_exitcode(int exitcode)
return "abort";
case INCOMPLETE_EXITCODE:
return "incomplete";
+ case GRACEFUL_EXITCODE:
+ return "notrun";
default:
return "fail";
}
@@ -1180,7 +1184,7 @@ static void fill_from_journal(int fd,
}
}
- if (subtests->size && exitcode == IGT_EXIT_ABORT) {
+ if (subtests->size && (exitcode == IGT_EXIT_ABORT || exitcode == GRACEFUL_EXITCODE)) {
char *last_subtest = subtests->subs[subtests->size - 1].name;
char subtest_piglit_name[256];
struct json_object *subtest_obj;
@@ -1188,7 +1192,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) {