File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -719,6 +719,22 @@ test_expect_success HAVE_JQ 'flux job list outputs nnodes/ranks/nodelist correct
719719 echo $obj | jq -e ".nodelist == \"${nodes}\""
720720'
721721
722+ # use flux queue to ensure jobs stay in pending state
723+ test_expect_success HAVE_JQ ' flux job list lists nnodes for pending jobs correctly' '
724+ flux queue stop &&
725+ id1=$(flux mini submit -N1 hostname | flux job id) &&
726+ echo ${id1} >> nnodes.ids &&
727+ id2=$(flux mini submit -N3 hostname | flux job id) &&
728+ echo ${id2} >> nnodes.ids &&
729+ flux job list -s pending | grep ${id1} &&
730+ flux job list -s pending | grep ${id2} &&
731+ flux job list-ids ${id1} | jq -e ".nnodes == 1" &&
732+ flux job list-ids ${id2} | jq -e ".nnodes == 3" &&
733+ flux job cancel ${id1} &&
734+ flux job cancel ${id2} &&
735+ flux queue start
736+ '
737+
722738#
723739# job success
724740#
Original file line number Diff line number Diff line change @@ -1135,6 +1135,24 @@ test_expect_success HAVE_JQ 'flux jobs works on job with illegal R' '
11351135 test_cmp list_illegal_R.out list_illegal_R.exp
11361136'
11371137
1138+ #
1139+ # special tests
1140+ #
1141+
1142+ # use flux queue to ensure jobs stay in pending state
1143+ test_expect_success HAVE_JQ ' flux jobs lists nnodes for pending jobs correctly' '
1144+ flux queue stop &&
1145+ id1=$(flux mini submit -N1 hostname) &&
1146+ id2=$(flux mini submit -N3 hostname) &&
1147+ flux jobs -no "{state},{nnodes},{nnodes:h}" ${id1} ${id2}> nnodesP.out &&
1148+ echo "SCHED,1,1" >> nnodesP.exp &&
1149+ echo "SCHED,3,3" >> nnodesP.exp &&
1150+ flux job cancel ${id1} &&
1151+ flux job cancel ${id2} &&
1152+ flux queue start &&
1153+ test_cmp nnodesP.exp nnodesP.out
1154+ '
1155+
11381156#
11391157# leave job cleanup to rc3
11401158#
You can’t perform that action at this time.
0 commit comments