selftests/sched_ext: Abort test loop on signal
Subsystems (2)
PATCH 1/1 selftests/sched_ext: Abort test loop on signal
The runner sets exit_req on SIGINT/SIGTERM but ignores it during the main loop. This prevents users from cleanly interrupting a test run.
Check exit_req each iteration to safely break out on exit signals.
Signed-off-by Cheng-Yang Chou <[email protected]>
--- tools/testing/selftests/sched_ext/runner.c | 3 +++ 1 file changed, 3 insertions(+)
tools/testing/selftests/sched_ext/runner.c +3 -0
@@ -166,6 +166,9 @@ int main(int argc, char **argv)enum scx_test_status status;struct scx_test *test = &__scx_tests[i]; +if (exit_req) +break ; +if (list) {printf ("%s\n" , test->name);if (i == (__scx_num_tests -1 ))
Signature · 1 line
2.48.1
Quoted 6 lines · Cheng-Yang Chou
The runner sets
exit_reqon SIGINT/SIGTERM but ignores it during the main loop. This prevents users from cleanly interrupting a test run.Check
exit_reqeach iteration to safely break out on exit signals.Signed-off-by Cheng-Yang Chou <[email protected]>
Looks good to me.
Acked-by Andrea Righi <[email protected]>
Thanks,
-Andrea
Quoted 21 lines
--- tools/testing/selftests/sched_ext/runner.c | 3 +++ 1 file changed, 3 insertions(+)tools/testing/selftests/sched_ext/runner.c +3
-0@@ -166,6 +166,9 @@ int main(int argc, char **argv)enum scx_test_status status;struct scx_test *test = &__scx_tests[i]; +if (exit_req) +break ; +if (list) {printf ("%s\n" , test->name);if (i == (__scx_num_tests -1 ))Signature · 1 line
2.48.1
Applied to sched_ext/for-7.0-fixes.
Thanks.
--
tejun