[igt-dev] [PATCH i-g-t 1/2] runner: Don't try to execute an empty set of subtests

Petri Latvala petri.latvala at intel.com
Wed Oct 3 13:08:45 UTC 2018


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 at intel.com>
Cc: Martin Peres <martin.peres at linux.intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler at 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



More information about the igt-dev mailing list