All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/sched_ext: flush stdout before test to avoid log spam
@ 2025-12-05 21:23 Emil Tsalapatis
  2025-12-12 18:19 ` Tejun Heo
  2025-12-12 18:19 ` Tejun Heo
  0 siblings, 2 replies; 3+ messages in thread
From: Emil Tsalapatis @ 2025-12-05 21:23 UTC (permalink / raw)
  To: sched-ext
  Cc: tj, arighi, changwoo, void, Emil Tsalapatis, Ihor Solodrai,
	Emil Tsalapatis

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>
---
 tools/testing/selftests/sched_ext/runner.c | 8 ++++++++
 1 file changed, 8 insertions(+)

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)
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests/sched_ext: flush stdout before test to avoid log spam
  2025-12-05 21:23 [PATCH] selftests/sched_ext: flush stdout before test to avoid log spam Emil Tsalapatis
@ 2025-12-12 18:19 ` Tejun Heo
  2025-12-12 18:19 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2025-12-12 18:19 UTC (permalink / raw)
  To: Emil Tsalapatis
  Cc: sched-ext, arighi, changwoo, void, Ihor Solodrai, Emil Tsalapatis

Applied to sched_ext/for-6.19-fixes.

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests/sched_ext: flush stdout before test to avoid log spam
  2025-12-05 21:23 [PATCH] selftests/sched_ext: flush stdout before test to avoid log spam Emil Tsalapatis
  2025-12-12 18:19 ` Tejun Heo
@ 2025-12-12 18:19 ` Tejun Heo
  1 sibling, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2025-12-12 18:19 UTC (permalink / raw)
  To: Emil Tsalapatis
  Cc: sched-ext, arighi, changwoo, void, Ihor Solodrai, Emil Tsalapatis

Applied to sched_ext/for-6.19-fixes.

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-12 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-05 21:23 [PATCH] selftests/sched_ext: flush stdout before test to avoid log spam Emil Tsalapatis
2025-12-12 18:19 ` Tejun Heo
2025-12-12 18:19 ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.