public inbox for igt-dev@lists.freedesktop.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 1/4] lib: Don't dump log buffer when dynamic subtest failure is inherited
Date: Tue, 14 Jan 2020 11:17:42 +0200	[thread overview]
Message-ID: <20200114091745.4555-1-petri.latvala@intel.com> (raw)

A subtest with dynamic subparts will automatically fail if any dynamic
subparts fail. Failing a subtest will dump our log buffer, which is
useful in normal cases, but when it's just the actual subtest
inheriting the failure from a dynamic subtest, nothing in the log
buffer is of any use for the failure.

Dynamic subtest parsing will stuff all output after the last dynamic
subtest into that last dynamic subtest's output, and in the case of
that last dynamic subtest itself being a 'SUCCESS', that extra output
from dumping the log buffer will cause an innocent dynamic subtest to
be incorrectly marked as a 'WARN' result.

Issue: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/66
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 lib/igt_core.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index c705be1e..0a006894 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -370,6 +370,23 @@ static void _igt_log_buffer_dump(void)
 {
 	uint8_t i;
 
+	if (in_subtest && !in_dynamic_subtest && _igt_dynamic_tests_executed >= 0) {
+		/*
+		 * We're exiting a subtest with dynamic subparts and
+		 * we're reaching this function because a dynamic
+		 * subpart failed which automatically translates to
+		 * the subtest failing. There cannot be anything in
+		 * the log buffer that is of any use to anyone; The
+		 * dynamic subpart that failed has already printed out
+		 * the real reason for the failure, and dumping the
+		 * buffer at this point will only cause the last
+		 * executed dynamic part be incorrectly marked as
+		 * 'WARN' by igt_runner.
+		 */
+		_igt_log_buffer_reset();
+		return;
+	}
+
 	if (in_dynamic_subtest)
 		fprintf(stderr, "Dynamic subtest %s failed.\n", in_dynamic_subtest);
 	else if (in_subtest)
-- 
2.20.1

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

             reply	other threads:[~2020-01-14  9:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14  9:17 Petri Latvala [this message]
2020-01-14  9:17 ` [igt-dev] [PATCH i-g-t 2/4] runner_tests: Replace magic numbers with named constants Petri Latvala
2020-01-14  9:17 ` [igt-dev] [PATCH i-g-t 3/4] runner_tests: Add new mockup test binary Petri Latvala
2020-01-14  9:17 ` [igt-dev] [PATCH i-g-t 4/4] runner_tests: Test that dynamic subtest failure is handled correctly Petri Latvala
2020-01-15 13:09   ` Arkadiusz Hiler
2020-01-16 11:47     ` Petri Latvala
2020-01-14  9:38 ` [igt-dev] ✗ GitLab.Pipeline: warning for series starting with [i-g-t,1/4] lib: Don't dump log buffer when dynamic subtest failure is inherited Patchwork
2020-01-14 10:12 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2020-01-16 10:36 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

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=20200114091745.4555-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox