Skip to content

Commit

Permalink
testsuite: drop job-list tests for illegal KVS content
Browse files Browse the repository at this point in the history
Problem: job-list now obtains the eventlog, R, and jobspec
exclusively from the job manager journal, but tests try to
elicit various errors by corrupting those objects in the KVS
and restarting job-list.

There is not a way to get corrupted objects past the job-manager,
so just drop those tests.
  • Loading branch information
garlick committed Mar 29, 2024
1 parent 1612e15 commit e683a77
Showing 1 changed file with 0 additions and 83 deletions.
83 changes: 0 additions & 83 deletions t/t2260-job-list.t
Original file line number Diff line number Diff line change
Expand Up @@ -2782,89 +2782,6 @@ test_expect_success 'reload job-ingest with defaults' '
ingest_module reload
'

# we make R invalid by overwriting it in the KVS before job-list will
# look it up
test_expect_success 'flux job list works on job with illegal R/json' '
${RPC} job-list.job-state-pause 0 </dev/null &&
jobid=`flux submit --wait hostname | flux job id` &&
jobkvspath=`flux job id --to kvs $jobid` &&
flux kvs put "${jobkvspath}.R=foobar" &&
${RPC} job-list.job-state-unpause 0 </dev/null &&
i=0 &&
while ! flux job list --states=inactive | grep $jobid > /dev/null \
&& [ $i -lt 5 ]
do
sleep 1
i=$((i + 1))
done &&
test "$i" -lt "5" &&
flux job list --states=inactive | grep $jobid > list_illegal_R.out &&
cat list_illegal_R.out | $jq -e ".ranks == null" &&
cat list_illegal_R.out | $jq -e ".nnodes == null" &&
cat list_illegal_R.out | $jq -e ".nodelist == null" &&
cat list_illegal_R.out | $jq -e ".expiration == null"
'

test_expect_success 'flux job list works on job with illegal R/valid json' '
${RPC} job-list.job-state-pause 0 </dev/null &&
jobid=`flux submit --wait hostname | flux job id` &&
jobkvspath=`flux job id --to kvs $jobid` &&
flux kvs put "${jobkvspath}.R={}" &&
${RPC} job-list.job-state-unpause 0 </dev/null &&
i=0 &&
while ! flux job list --states=inactive | grep $jobid > /dev/null \
&& [ $i -lt 5 ]
do
sleep 1
i=$((i + 1))
done &&
test "$i" -lt "5" &&
flux job list --states=inactive | grep $jobid > list_illegal_R.out &&
cat list_illegal_R.out | $jq -e ".ranks == null" &&
cat list_illegal_R.out | $jq -e ".nnodes == null" &&
cat list_illegal_R.out | $jq -e ".nodelist == null" &&
cat list_illegal_R.out | $jq -e ".expiration == null"
'

test_expect_success NO_CHAIN_LINT 'flux job list-ids works on job with illegal R/json' '
${RPC} job-list.job-state-pause 0 </dev/null
jobid=`flux submit --wait hostname | flux job id`
jobkvspath=`flux job id --to kvs $jobid` &&
flux kvs put "${jobkvspath}.R=foobar" &&
flux job list-ids ${jobid} > list_id_illegal_R.out &
pid=$!
wait_idsync 1 &&
${RPC} job-list.job-state-unpause 0 </dev/null &&
wait $pid &&
cat list_id_illegal_R.out | $jq -e ".id == ${jobid}"
'

test_expect_success NO_CHAIN_LINT 'flux job list-ids works on job with illegal R/valid json' '
${RPC} job-list.job-state-pause 0 </dev/null
jobid=`flux submit --wait hostname | flux job id`
jobkvspath=`flux job id --to kvs $jobid` &&
flux kvs put "${jobkvspath}.R={}" &&
flux job list-ids ${jobid} > list_id_illegal_R.out &
pid=$!
wait_idsync 1 &&
${RPC} job-list.job-state-unpause 0 </dev/null &&
wait $pid &&
cat list_id_illegal_R.out | $jq -e ".id == ${jobid}"
'

test_expect_success NO_CHAIN_LINT 'flux job list-ids works on job with illegal eventlog' '
${RPC} job-list.job-state-pause 0 </dev/null
jobid=`flux submit --wait hostname | flux job id`
jobkvspath=`flux job id --to kvs $jobid` &&
flux kvs put "${jobkvspath}.eventlog=foobar" &&
flux job list-ids ${jobid} > list_id_illegal_eventlog.out &
pid=$!
wait_idsync 1 &&
${RPC} job-list.job-state-unpause 0 </dev/null &&
wait $pid &&
cat list_id_illegal_eventlog.out | $jq -e ".id == ${jobid}"
'

test_expect_success 'flux job list works on racy annotations' '
${RPC} job-list.job-state-pause 0 </dev/null &&
jobid=`flux submit --wait hostname | flux job id` &&
Expand Down

0 comments on commit e683a77

Please sign in to comment.