@@ -35,20 +35,19 @@ test_expect_success 'job-exec: ensure cancellation kills job' '
3535 test_expect_code 137 flux job status $id &&
3636 test_must_fail ps -q $pid
3737'
38+ # Note: increase max-kill-count here to ensure job doesn't disappear from
39+ # job-exec while we're testing kill-timeout:
3840test_expect_success ' job-exec: reload module with kill/term-signal=SIGURG' '
3941 flux module reload job-exec \
4042 kill-timeout=0.1s kill-signal=SIGURG term-signal=SIGURG \
41- max-kill-count=3
43+ max-kill-count=20
4244'
4345test_expect_success ' job-exec: submit a job' '
4446 jobid=$(flux submit --wait-event=start -n1 sleep inf)
4547'
4648test_expect_success ' job-exec: job is listed in flux-module stats' '
4749 flux module stats job-exec | jq .jobs.$jobid
4850'
49- test_expect_success ' job-exec: get sleep PID for later cleanup' '
50- sleep_pid=$(flux job hostpids $jobid | sed s/.*://)
51- '
5251test_expect_success ' job-exec: cancel test job to start kill timer' '
5352 flux cancel $jobid
5453'
@@ -79,6 +78,27 @@ test_expect_success 'job-exec: kill-timeout > original value (0.1)' '
7978 flux module stats job-exec | jq .jobs.${jobid}.kill_timeout &&
8079 flux module stats job-exec | jq -e ".jobs.${jobid}.kill_timeout > 0.1"
8180'
81+ test_expect_success ' job-exec: kill test job with SIGKILL' '
82+ flux job kill -s 9 $jobid &&
83+ flux job wait-event -vt 15 $jobid clean
84+ '
85+ test_expect_success ' job-exec: reload module with small max-kill-count' '
86+ flux module reload job-exec \
87+ kill-timeout=0.1s kill-signal=SIGURG term-signal=SIGURG \
88+ max-kill-count=3
89+ '
90+ test_expect_success ' job-exec: submit a job' '
91+ jobid=$(flux submit --wait-event=start -n1 sleep inf)
92+ '
93+ test_expect_success ' job-exec: job is listed in flux-module stats' '
94+ flux module stats job-exec | jq .jobs.$jobid
95+ '
96+ test_expect_success ' job-exec: get sleep PID for later cleanup' '
97+ sleep_pid=$(flux job hostpids $jobid | sed s/.*://)
98+ '
99+ test_expect_success ' job-exec: cancel test job to start kill timer' '
100+ flux cancel $jobid
101+ '
82102test_expect_success ' job-exec: wait for job to be terminated by max-kill-count' '
83103 flux job wait-event -vt 15 $jobid clean &&
84104 flux dmesg -H | grep "exceeded max kill count" &&
0 commit comments