[igt-dev] [PATCH i-g-t 1/1] runner: Flush igt_runner outputs before forking
From: Petri Latvala <hidden>
Date: 2018-09-19 11:49:22
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Petri Latvala <hidden>
Date: 2018-09-19 11:49:22
Subsystem:
the rest · Maintainer:
Linus Torvalds
If the output of igt_runner is piped or redirected, buffered prints could be left lingering and read as test executable output if execv() fails. This can happen easily if CI for example generates a testlist with an incorrect binary name, or an optional test binary (say, kms_chamelium) is not built for the deployment in question. Signed-off-by: Petri Latvala <redacted> Cc: Tomi Sarvela <redacted> Cc: Arkadiusz Hiler <redacted> --- runner/executor.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/runner/executor.c b/runner/executor.c
index 701ca80d..fd262eb4 100644
--- a/runner/executor.c
+++ b/runner/executor.c@@ -780,6 +780,14 @@ static int execute_entry(size_t idx, printf("\n"); } + /* + * Flush outputs before forking so our (buffered) output won't + * end up in the test outputs. + */ + + fflush(stdout); + fflush(stderr); + if ((child = fork())) { int outfd = outpipe[0]; int errfd = errpipe[0];
--
2.18.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev