Skip to content

Commit 0b10a63

Browse files
committed
testsuite: prep for flux-mini --time-limit change
Problem: The default for a unit-less duration specified to the flux-mini --time-limit=N option will soon change from seconds to minutes, but may tests in the testsuite assume seconds. Go through the testsuite and apply "s" units to all bare --time-limit arguments to ensure they are always interpreted in seconds. Also remove one test that ensures `-t5` works since after the change this will result in a 5 minute duration not 5 seconds.
1 parent ed42aff commit 0b10a63

File tree

6 files changed

+9
-13
lines changed

6 files changed

+9
-13
lines changed

t/t2212-job-manager-plugins.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ test_expect_success 'job-manager: load jobtap_api test plugin' '
223223
/bin/false) &&
224224
test_expect_code 1 flux job attach -vEX $id &&
225225
test_must_fail flux job wait-event $id exception &&
226-
id=$(flux mini submit -t 0.1 \
226+
id=$(flux mini submit -t 0.1s \
227227
--setattr=system.expected-result=timeout \
228228
sleep 10) &&
229229
test_must_fail flux job wait-event -vm type=test $id exception &&

t/t2220-job-manager-jobspec-default.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ test_expect_success HAVE_JQ 'the redacted jobspec contains default duration' '
7474
jq -e ".jobspec.attributes.system.duration == 3600" <getattr4.json
7575
'
7676
test_expect_success 'submit a job that overrides the default duration' '
77-
flux mini submit -t5 /bin/true >id5
77+
flux mini submit -t5s /bin/true >id5
7878
'
7979
test_expect_success HAVE_JQ 'the redacted jobspec contains the override' '
8080
jm_getattr $(cat id5) jobspec >getattr5.json &&
@@ -158,7 +158,7 @@ test_expect_success HAVE_JQ 'the redacted jobspec contains queue duration' '
158158
jq -e ".jobspec.attributes.system.duration == 99" <getattr8.json
159159
'
160160
test_expect_success 'submit a job with with queue and duration' '
161-
flux mini submit --setattr=system.queue=pdebug -t 111 /bin/true >id9
161+
flux mini submit --setattr=system.queue=pdebug -t 111s /bin/true >id9
162162
'
163163
test_expect_success HAVE_JQ 'the redacted jobspec contains user duration' '
164164
jm_getattr $(cat id9) jobspec >getattr9.json &&

t/t2260-job-list.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ test_expect_success HAVE_JQ 'flux job list outputs exceptions correctly (excepti
778778
# expiration time
779779

780780
test_expect_success HAVE_JQ 'flux job list outputs expiration time when set' '
781-
jobid=$(flux mini submit -t 30 sleep 1000 | flux job id) &&
781+
jobid=$(flux mini submit -t 30s sleep 1000 | flux job id) &&
782782
fj_wait_event $jobid start &&
783783
flux job list | grep $jobid > expiration.json &&
784784
test_debug "cat expiration.json" &&

t/t2607-job-shell-input.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ test_expect_success NO_CHAIN_LINT 'flux-shell: attach twice, one with data' '
7373
'
7474

7575
test_expect_success 'flux-shell: multiple jobs, each want stdin' '
76-
flux mini submit --cc=1-4 -n1 -t 30 \
76+
flux mini submit --cc=1-4 -n1 -t 30s \
7777
${TEST_SUBPROCESS_DIR}/test_echo -O -n >pipe5.jobids &&
7878
test_debug "cat pipe5.jobids" &&
7979
i=1 &&
@@ -151,7 +151,7 @@ test_expect_success 'flux-shell: run 2-task input file as stdin job' '
151151
'
152152

153153
test_expect_success 'flux-shell: multiple jobs, each want stdin via file' '
154-
flux mini submit --cc=1-4 -n1 -t 30 --input=input_stdin_file \
154+
flux mini submit --cc=1-4 -n1 -t 30s --input=input_stdin_file \
155155
${TEST_SUBPROCESS_DIR}/test_echo -O -n >file2.jobids &&
156156
test_debug "cat file2.jobids" &&
157157
i=1 &&

t/t2700-mini-cmd.t

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ test_expect_success HAVE_JQ 'flux mini submit -t5s works' '
112112
flux mini submit --dry-run -t5s hostname >t5s.out &&
113113
jq -e ".attributes.system.duration == 5" < t5s.out
114114
'
115-
test_expect_success HAVE_JQ 'flux mini submit -t5 works' '
116-
flux mini submit --dry-run -t5 hostname >t5.out &&
117-
jq -r ".attributes.system.duration == 300"
118-
'
119115
test_expect_success 'flux mini submit --time-limit=00:30 fails' '
120116
test_must_fail flux mini submit --time-limit=00:30 hostname 2>st.err &&
121117
grep -i "invalid Flux standard duration" st.err

t/t2900-job-timelimits.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test_have_prereq ASAN && TIMEOUT=3
1616

1717
test_expect_success 'job time limits are enforced' '
1818
test_expect_code 142 \
19-
flux mini run --time-limit=${TIMEOUT} sleep 30 2>limit1.err &&
19+
flux mini run --time-limit=${TIMEOUT}s sleep 30 2>limit1.err &&
2020
grep "resource allocation expired" limit1.err
2121
'
2222
test_expect_success HAVE_JQ 'job timelimits are propagated' '
@@ -57,7 +57,7 @@ sigalrm_sigkill_test() {
5757
flux module reload job-exec kill-timeout=$kill_timeout &&
5858
ofile=trap.$scale.out &&
5959
test_must_fail_or_be_terminated \
60-
flux mini run -vvv --time-limit=${timeout} bash -xc \
60+
flux mini run -vvv --time-limit=${timeout}s bash -xc \
6161
"trap \"echo got SIGALRM>>$ofile\" SIGALRM;sleep 10;sleep 15" \
6262
> $ofile 2> trap.$scale.err &&
6363
test_debug "grep . trap.*" &&
@@ -74,7 +74,7 @@ test_expect_success 'expired jobs are sent SIGALRM, then SIGKILL' '
7474
done
7575
'
7676
expired_cancel_test() {
77-
id=$(flux mini submit --time-limit=$1 bash -c \
77+
id=$(flux mini submit --time-limit=${1}s bash -c \
7878
"trap \"echo got SIGALRM>>trap2.out\" SIGALRM;sleep 60;sleep 60" ) &&
7979
flux job wait-event --timeout=30 $id exception &&
8080
flux job cancel $id &&

0 commit comments

Comments
 (0)