public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/4] lib: Don't dump log buffer when dynamic subtest failure is inherited
@ 2020-01-14  9:17 Petri Latvala
  2020-01-14  9:17 ` [igt-dev] [PATCH i-g-t 2/4] runner_tests: Replace magic numbers with named constants Petri Latvala
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Petri Latvala @ 2020-01-14  9:17 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

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

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-01-16 11:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-14  9:17 [igt-dev] [PATCH i-g-t 1/4] lib: Don't dump log buffer when dynamic subtest failure is inherited Petri Latvala
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox