[igt-dev] [PATCH i-g-t 1/4] lib: Don't dump log buffer when dynamic subtest failure is inherited
Petri Latvala
petri.latvala at intel.com
Tue Jan 14 09:17:42 UTC 2020
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 at intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler at 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
More information about the igt-dev
mailing list