summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/sched_ext/runner.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/sched_ext/runner.c')
-rw-r--r--tools/testing/selftests/sched_ext/runner.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/sched_ext/runner.c b/tools/testing/selftests/sched_ext/runner.c
index aa2d7d32dda9..5748d2c69903 100644
--- a/tools/testing/selftests/sched_ext/runner.c
+++ b/tools/testing/selftests/sched_ext/runner.c
@@ -46,6 +46,14 @@ static void print_test_preamble(const struct scx_test *test, bool quiet)
if (!quiet)
printf("DESCRIPTION: %s\n", test->description);
printf("OUTPUT:\n");
+
+ /*
+ * The tests may fork with the preamble buffered
+ * in the children's stdout. Flush before the test
+ * to avoid printing the message multiple times.
+ */
+ fflush(stdout);
+ fflush(stderr);
}
static const char *status_to_result(enum scx_test_status status)