Skip to content

Commit 04b3054

Browse files
chu11mergify[bot]
authored andcommitted
testsuite: update nocheckpoint tests
Problem: Queue state is no longer checkpointed after every change in queue state. It is only checkpointed when the job-manager module is unloaded. This change breaks several tests. Solution: Update several --nocheckpoint tests that checked the checkpoint immediately after a queue state change. Instead start a sub-instance and check the KVS dump created after the subinstance completes.
1 parent 14edfa1 commit 04b3054

File tree

1 file changed

+38
-23
lines changed

1 file changed

+38
-23
lines changed

t/t2240-queue-cmd.t

Lines changed: 38 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,16 @@ test_expect_success 'flux-queue: status reports no reason for stop' '
126126
'
127127

128128
test_expect_success HAVE_JQ 'flux-queue: stop with --nocheckpoint works' '
129-
flux queue start &&
130-
flux kvs get checkpoint.job-manager | jq -e ".queue[0].start == true" &&
131-
flux queue stop --nocheckpoint &&
132-
flux kvs get checkpoint.job-manager | jq -e ".queue[0].start == true" &&
133-
flux queue status >status3.out &&
134-
cat <<-EOT >status3.exp &&
135-
Job submission is enabled
136-
Scheduling is stopped
137-
EOT
138-
test_cmp status3.exp status3.out
129+
flux start \
130+
-o,-Scontent.dump=dump_queue_nocheckpoint1.tar \
131+
flux queue stop &&
132+
tar -xvf dump_queue_nocheckpoint1.tar &&
133+
cat checkpoint/job-manager | jq -e ".queue[0].start == false" &&
134+
flux start \
135+
-o,-Scontent.dump=dump_queue_nocheckpoint2.tar \
136+
flux queue stop --nocheckpoint &&
137+
tar -xvf dump_queue_nocheckpoint2.tar &&
138+
cat checkpoint/job-manager | jq -e ".queue[0].start == true"
139139
'
140140

141141
test_expect_success 'flux-queue: submit some jobs' '
@@ -533,19 +533,34 @@ test_expect_success 'previously submitted job run to completion' '
533533
flux jobs -n -o "{state}" $(cat job_batch2.id) | grep INACTIVE
534534
'
535535

536-
# for this test we pick one the first queue's name to stop, but we don't care
537-
# which one it is
538-
test_expect_success HAVE_JQ 'flux-queue: stop with one queue and --nocheckpoint works' '
539-
flux queue start --all &&
540-
flux kvs get checkpoint.job-manager | jq -e ".queue[0].start == true" &&
541-
flux kvs get checkpoint.job-manager | jq -e ".queue[1].start == true" &&
542-
flux kvs get checkpoint.job-manager | jq -r ".queue[0].name" > name.out &&
543-
flux queue stop -q $(cat name.out) --nocheckpoint nocheckpoint &&
544-
flux queue status >mqstatus_nocheckpoint.out &&
545-
test $(grep -c "Scheduling is started" mqstatus_nocheckpoint.out) -eq 1 &&
546-
test $(grep -c "Scheduling is stopped: nocheckpoint" mqstatus_nocheckpoint.out) -eq 1 &&
547-
flux kvs get checkpoint.job-manager | jq -e ".queue[0].start == true" &&
548-
flux kvs get checkpoint.job-manager | jq -e ".queue[1].start == true"
536+
test_expect_success HAVE_JQ 'flux-queue: stop with named queues and --nocheckpoint works' '
537+
mkdir -p conf.d &&
538+
cat >conf.d/queues.toml <<-EOT &&
539+
[queues.debug]
540+
[queues.batch]
541+
EOT
542+
cat >stopqueues.sh <<-EOT &&
543+
flux queue start --all
544+
flux queue stop --all
545+
EOT
546+
cat >stopqueuesnocheckpoint.sh <<-EOT &&
547+
flux queue start --all
548+
flux queue stop --all --nocheckpoint
549+
EOT
550+
chmod +x ./stopqueues.sh &&
551+
chmod +x ./stopqueuesnocheckpoint.sh &&
552+
flux start -o,--config-path=$(pwd)/conf.d \
553+
-o,-Scontent.dump=dump_queue_named_nocheckpoint1.tar \
554+
./stopqueues.sh &&
555+
tar -xvf dump_queue_named_nocheckpoint1.tar &&
556+
cat checkpoint/job-manager | jq -e ".queue[0].start == false" &&
557+
cat checkpoint/job-manager | jq -e ".queue[1].start == false" &&
558+
flux start -o,--config-path=$(pwd)/conf.d \
559+
-o,-Scontent.dump=dump_queue_named_nocheckpoint2.tar \
560+
./stopqueuesnocheckpoint.sh &&
561+
tar -xvf dump_queue_named_nocheckpoint2.tar &&
562+
cat checkpoint/job-manager | jq -e ".queue[0].start == true" &&
563+
cat checkpoint/job-manager | jq -e ".queue[1].start == true"
549564
'
550565

551566
test_expect_success 'flux-queue: quiet option works with one queue' '

0 commit comments

Comments
 (0)