Skip to content

Commit a165050

Browse files
committed
testsuite: move special ntasks test
Problem: A special case ntask test located in t2800-jobs-cmd.t really should be in t2260-job-list.t, located amongst a large mix of ntasks tests. Solution: Move the test to t2260-job-list.t, adjusting it and surrounding tests accordingly.
1 parent 26101d7 commit a165050

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

t/t2260-job-list.t

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,22 @@ test_expect_success HAVE_JQ 'flux job list outputs ntasks correctly (tasks-per-n
711711
echo $obj | jq -e ".ntasks == 6"
712712
'
713713

714+
test_expect_success 'flux jobs list outputs ntasks correctly (per-resource.type=node)' '
715+
nnodes=$(flux resource list -s up -no {nnodes}) &&
716+
ncores=$(flux resource list -s up -no {ncores}) &&
717+
extra=$((ncores / nnodes + 2)) &&
718+
jobid=$(flux mini submit --wait -N ${nnodes} -n ${ncores} \
719+
-o per-resource.type=node \
720+
-o per-resource.count=${extra} \
721+
hostname | flux job id) &&
722+
echo $jobid > taskcount6.id &&
723+
wait_jobid_state $jobid inactive &&
724+
obj=$(flux job list -s inactive | grep $jobid) &&
725+
expected=$((nnodes * extra)) &&
726+
echo ${expected} > per_resource_type_node_ntasks.exp &&
727+
echo $obj | jq -e ".ntasks == ${expected}"
728+
'
729+
714730
test_expect_success 'reload the job-list module' '
715731
flux module reload job-list
716732
'
@@ -721,6 +737,7 @@ test_expect_success HAVE_JQ 'verify task count preserved across restart' '
721737
jobid3=`cat taskcount3.id` &&
722738
jobid4=`cat taskcount4.id` &&
723739
jobid5=`cat taskcount5.id` &&
740+
jobid6=`cat taskcount6.id` &&
724741
obj=$(flux job list -s inactive | grep ${jobid1}) &&
725742
echo $obj | jq -e ".ntasks == 1" &&
726743
obj=$(flux job list -s inactive | grep ${jobid2}) &&
@@ -730,7 +747,10 @@ test_expect_success HAVE_JQ 'verify task count preserved across restart' '
730747
obj=$(flux job list -s inactive | grep ${jobid4}) &&
731748
echo $obj | jq -e ".ntasks == 3" &&
732749
obj=$(flux job list -s inactive | grep ${jobid5}) &&
733-
echo $obj | jq -e ".ntasks == 6"
750+
echo $obj | jq -e ".ntasks == 6" &&
751+
obj=$(flux job list -s inactive | grep ${jobid6}) &&
752+
expected=$(cat per_resource_type_node_ntasks.exp) &&
753+
echo $obj | jq -e ".ntasks == ${expected}"
734754
'
735755

736756
#

t/t2800-jobs-cmd.t

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,21 +1231,6 @@ test_expect_success HAVE_JQ 'flux jobs lists nnodes for pending jobs correctly'
12311231
test_cmp nnodesP.exp nnodesP.out
12321232
'
12331233

1234-
# over subscribe tasks onto nodes through workaround, ensure
1235-
# ntasks is larger than the tasks specified via -n option
1236-
test_expect_success 'flux jobs lists ntasks with per-resource type=node correctly' '
1237-
nnodes=$(flux resource list -s up -no {nnodes}) &&
1238-
ncores=$(flux resource list -s up -no {ncores}) &&
1239-
extra=$((ncores / nnodes + 2)) &&
1240-
id=$(flux mini submit -N ${nnodes} -n ${ncores} \
1241-
-o per-resource.type=node \
1242-
-o per-resource.count=${extra} \
1243-
/bin/true) &&
1244-
fj_wait_event ${id} clean &&
1245-
flux jobs -no "{ntasks}" ${id} > per_resource_ntasks.out &&
1246-
test $(cat per_resource_ntasks.out) -eq $((nnodes * extra))
1247-
'
1248-
12491234
#
12501235
# leave job cleanup to rc3
12511236
#

0 commit comments

Comments
 (0)