Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests/sched_ext: flush stdout before test to avoid log spam

The sched_ext selftests runner runs each test in the same process,
with each test possibly forking multiple times. When the main runner
has not flushed its stdout, the children inherit the buffered output
for previous tests and emit it during exit. This causes log spam.

Make sure stdout/stderr is fully flushed before each test.

Cc: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Emil Tsalapatis <emil@etsalapatis.com>
Signed-off-by: Tejun Heo <tj@kernel.org>

authored by

Emil Tsalapatis and committed by
Tejun Heo
579a3297 f5e1e5ec

+8
+8
tools/testing/selftests/sched_ext/runner.c
··· 46 46 if (!quiet) 47 47 printf("DESCRIPTION: %s\n", test->description); 48 48 printf("OUTPUT:\n"); 49 + 50 + /* 51 + * The tests may fork with the preamble buffered 52 + * in the children's stdout. Flush before the test 53 + * to avoid printing the message multiple times. 54 + */ 55 + fflush(stdout); 56 + fflush(stderr); 49 57 } 50 58 51 59 static const char *status_to_result(enum scx_test_status status)