All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t] runner: Fix graceful exit result parsing for dynamic subtests
Date: Mon, 25 Jan 2021 15:55:14 +0200	[thread overview]
Message-ID: <20210125135514.23925-1-petri.latvala@intel.com> (raw)

Commit 10c83dfa5ad2 ("runner: Introduce a way to stop testing without
marking tests incomplete") added graceful exiting by signaling the
runner with SIGHUP, marking the currently running test as 'notrun'
instead of 'incomplete'. The result handling didn't handle dynamic
subtests though, so the currently executing dynamic subtest was still
marked as 'incomplete'. Handle that now similarly as handling the
'abort' result.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arek@hiler.eu>
---
 runner/resultgen.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/runner/resultgen.c b/runner/resultgen.c
index 8d0c6249..b74970a6 100644
--- a/runner/resultgen.c
+++ b/runner/resultgen.c
@@ -656,19 +656,24 @@ static void process_dynamic_subtest_output(const char *piglit_name,
 					     dynend);
 
 			/*
-			 * If a dynamic subsubtest is considered incomplete we
-			 * need to check parent's status first, to be sure that
-			 * the binary hasn't aborted (exit code). If it has
-			 * aborted then we have to attribute this status to our
-			 * subsubtest.
+			 * If a dynamic subsubtest is considered
+			 * incomplete we need to check parent's status
+			 * first, to be sure that the binary hasn't
+			 * aborted or stopped gracefully (exit
+			 * code). If it has aborted then we have to
+			 * attribute this status to our subsubtest.
 			 */
 			if (!strcmp(dynresulttext, "incomplete")) {
 				struct json_object *parent_subtest;
 
 				if (json_object_object_get_ex(tests, piglit_name, &parent_subtest) &&
-				    json_object_object_get_ex(parent_subtest, "result", &parent_subtest) &&
-				    !strcmp(json_object_get_string(parent_subtest), "abort"))
-					dynresulttext = "abort";
+				    json_object_object_get_ex(parent_subtest, "result", &parent_subtest)) {
+					const char *resulttext = json_object_get_string(parent_subtest);
+
+					if (!strcmp(resulttext, "abort") ||
+					    !strcmp(resulttext, "notrun"))
+						dynresulttext = resulttext;
+				}
 			}
 
 			set_result(current_dynamic_test, dynresulttext);
-- 
2.29.2

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

             reply	other threads:[~2021-01-25 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 13:55 Petri Latvala [this message]
2021-01-25 15:59 ` [igt-dev] ✓ Fi.CI.BAT: success for runner: Fix graceful exit result parsing for dynamic subtests Patchwork
2021-01-25 19:58 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-01-26 11:07 ` [igt-dev] [PATCH i-g-t] " Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210125135514.23925-1-petri.latvala@intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.