Skip to content

Commit

Permalink
testsuite: cover job-list max_comparisons config
Browse files Browse the repository at this point in the history
Problem: The new job-list max_comparisons config is not covered.

Add tests in t2260-job-list.t.
  • Loading branch information
chu11 committed Feb 2, 2024
1 parent 27b1754 commit c24ac88
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions t/t2260-job-list.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ test_description='Test flux job list services'

. $(dirname $0)/sharness.sh

export FLUX_CONF_DIR=$(pwd)
test_under_flux 4 job

RPC=${FLUX_BUILD_DIR}/t/request/rpc
Expand Down Expand Up @@ -2087,6 +2088,69 @@ test_expect_success 'list request with all attr works (job fail)' '
cat all_fail.out | jq -e ".result"
'

#
# max comparison
#

test_expect_success 'default comparison can get all of the jobs' '
flux job list -A > /dev/null
'

test_expect_success 'remove job list module' '
flux module remove job-list
'

test_expect_success 'job-list: invalid max_comparisons leads to error' '
cat >joblist.toml <<EOF &&
[job-list]
max_comparisons = -1
EOF
flux config reload &&
test_must_fail flux module load job-list
'

test_expect_success 'job-list: config low max_comparisons' '
cat >joblist.toml <<EOF &&
[job-list]
max_comparisons = 10
EOF
flux config reload &&
flux module load job-list
'

test_expect_success 'flux job list fails on low comparison count' '
test_must_fail flux job list -A > /dev/null
'

test_expect_success 'job-list: update config with invalid input fails' '
test_must_fail flux config load <<-EOF
[job-list]
max_comparisons = -1
EOF
'

test_expect_success 'job-list: update config biggerr max_comparisons' '
flux config load <<-EOF
[job-list]
max_comparisons = 10000
EOF
'

test_expect_success 'flux job list works again' '
flux job list -A > /dev/null
'

test_expect_success 'job-list: update config no comparison limit' '
flux config load <<-EOF
[job-list]
max_comparisons = 0
EOF
'

test_expect_success 'flux job list works' '
flux job list -A > /dev/null
'

#
# job-list can handle flux-restart events
#
Expand Down

0 comments on commit c24ac88

Please sign in to comment.