[PATCH i-g-t v2 1/1] runner/executor: sync outputs after tests end
Kamil Konieczny
kamil.konieczny at linux.intel.com
Thu Apr 10 10:05:37 UTC 2025
In CI runs there are sometimes tests reported as incomplete
after a crash and there are more such incompletes before a one
that caused actual crash. It turns out that there were missing
ends of tests dmesg logs gathered in a test subdirectory. After
cross checks with a global dmesg log saved outside of igt_runner,
it seems that all tests before crushed one properly reported its
end to kernel kmsg.
Try to remediate this and create additional syncs for logs just
after end of execution, with additional syncs for directories.
v2: applied r-b, added missing static keyword, re-worded
desciption (Kamil)
Cc: Krzysztof Karas <krzysztof.karas at intel.com>
Cc: Peter Senna Tschudin <peter.senna at linux.intel.com>
Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
Reviewed-by: Ryszard Knop <ryszard.knop at intel.com>
---
runner/executor.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/runner/executor.c b/runner/executor.c
index 30e2420af..41f521e56 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -615,6 +615,16 @@ void close_outputs(int *fds)
}
}
+static void fsync_outputs(int *fds)
+{
+ int i;
+
+ for (i = 0; i < _F_LAST; i++) {
+ if (fds[i] >= 0)
+ fsync(fds[i]);
+ }
+}
+
const char *get_out_filename(int fid)
{
if (fid >= 0 && fid < _F_LAST)
@@ -1871,14 +1881,19 @@ static int execute_next_entry(struct execute_state *state,
out_kmsgfd:
close(kmsgfd);
out_pipe:
- close_outputs(outputs);
close(outpipe[0]);
close(outpipe[1]);
close(errpipe[0]);
close(errpipe[1]);
+ if (settings->sync)
+ fsync_outputs(outputs);
close_outputs(outputs);
out_dirfd:
+ if (settings->sync)
+ fsync(dirfd);
close(dirfd);
+ if (settings->sync)
+ fsync(resdirfd);
return result;
}
--
2.49.0
More information about the igt-dev
mailing list