mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/sched_ext: Fail interrupted test runs
@ 2026-09-06 13:54 Tianyi Chen
  2026-09-08 18:01 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Tianyi Chen @ 2026-09-06 13:54 UTC (permalink / raw)
  To: Tejun Heo, David Vernet
  Cc: Tianyi Chen, Andrea Righi, Changwoo Min, Shuah Khan, sched-ext,
	linux-kselftest, linux-kernel, Cheng-Yang Chou

SIGINT and SIGTERM set exit_req, causing the runner to stop before
executing the remaining tests. However, the exit status only reflects
the number of failed tests, so an interrupted run returns success when
none of the completed tests failed.

Include exit_req in the failure condition so callers can distinguish
an interrupted run from a successful run. Keep the result counts
limited to the tests that actually ran.

Tested the actual runner under GDB, delivering each signal before the
first test and after the example test passed. The original runner
returns 0 in all four cases; the fixed runner returns 1. Normal -h,
-l and -t example invocations still return 0.

Fixes: 9d851afa4826 ("selftests/sched_ext: Abort test loop on signal")
Assisted-by: LLM
Signed-off-by: Tianyi Chen <hi@tychen.cc>
---
 tools/testing/selftests/sched_ext/runner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/sched_ext/runner.c b/tools/testing/selftests/sched_ext/runner.c
index c264807caa9..57dda75384f 100644
--- a/tools/testing/selftests/sched_ext/runner.c
+++ b/tools/testing/selftests/sched_ext/runner.c
@@ -243,7 +243,7 @@ int main(int argc, char **argv)
 			printf("  - %s\n", failed_tests[i]);
 	}
 
-	return failed > 0 ? 1 : 0;
+	return failed > 0 || exit_req ? 1 : 0;
 }
 
 void scx_test_register(struct scx_test *test)
-- 
2.55.0


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

end of thread, other threads:[~2026-09-08 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-06 13:54 [PATCH] selftests/sched_ext: Fail interrupted test runs Tianyi Chen
2026-09-08 18:01 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®