All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Martin Peres <martin.peres@linux.intel.com>
Subject: [igt-dev] [PATCH i-g-t 1/2] runner: Don't try to execute an empty set of subtests
Date: Wed,  3 Oct 2018 16:08:45 +0300	[thread overview]
Message-ID: <20181003130846.8281-1-petri.latvala@intel.com> (raw)

If we resume a test run with igt_resume, or if resume is done
automatically from a test timeout, the runner will execute the last
attempted test with the subtest selection set to original set minus
the subtests already journaled to have started. If this results in an
empty set, we get a harmless but misleading message from the test
saying

"igt_core-WARNING: Unknown subtest: subtest-name,!subtest-name"

If the journal already contains as many subtests as we have requested
(when we know the set), assume we have them all already and move to
the next job list entry instead.

Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Martin Peres <martin.peres@linux.intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 runner/executor.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/runner/executor.c b/runner/executor.c
index 4552b02c..8b87a421 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -140,7 +140,8 @@ static bool prune_from_journal(struct job_list_entry *entry, int fd)
 {
 	char *subtest;
 	FILE *f;
-	bool any_pruned = false;
+	size_t pruned = 0;
+	size_t old_count = entry->subtest_count;
 
 	/*
 	 * Each journal line is a subtest that has been started, or
@@ -169,11 +170,19 @@ static bool prune_from_journal(struct job_list_entry *entry, int fd)
 		prune_subtest(entry, subtest);
 
 		free(subtest);
-		any_pruned = true;
+		pruned++;
 	}
 
 	fclose(f);
-	return any_pruned;
+
+	/*
+	 * If we know the subtests we originally wanted to run, check
+	 * if we got an equal amount already.
+	 */
+	if (old_count > 0 && pruned >= old_count)
+		entry->binary[0] = '\0';
+
+	return pruned > 0;
 }
 
 static const char *filenames[_F_LAST] = {
-- 
2.18.0

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

             reply	other threads:[~2018-10-03 13:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 13:08 Petri Latvala [this message]
2018-10-03 13:08 ` [igt-dev] [PATCH i-g-t 2/2] runner: Add unit test for resume when enough subtests are already run Petri Latvala
2018-10-03 17:20 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] runner: Don't try to execute an empty set of subtests Patchwork
2018-10-04  8:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-10-04 10:43 ` [igt-dev] [PATCH i-g-t 1/2] " Arkadiusz Hiler

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=20181003130846.8281-1-petri.latvala@intel.com \
    --to=petri.latvala@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=martin.peres@linux.intel.com \
    /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.