Skip to content

Commit

Permalink
testsuite: cover job stats update
Browse files Browse the repository at this point in the history
Problem: there is no coverage to ensure flux-job --stats-only
shows correct inactive job count after purge.

Add a test.
  • Loading branch information
garlick committed Apr 16, 2022
1 parent 0d3714c commit 4ca4c93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion t/t2809-job-purge.t
Expand Up @@ -14,8 +14,13 @@ inactive_count() {

if test $how = "job-manager"; then
flux module stats --parse=inactive_jobs job-manager
else # job-list
elif test $how = "job-list"; then
flux jobs --suppress-header --filter=inactive|wc -l
elif test $how = "job-list-stats"; then
flux job stats | jq .job_states.inactive
else
echo Unknown method: $how >&2
return 1
fi
}

Expand Down Expand Up @@ -137,6 +142,9 @@ test_expect_success 'reconfigure job manager with inactive-age-limit=1ms' '
test_expect_success 'wait for job-list inactive job count to reach 0' '
wait_inactive_count job-list 0 30
'
test_expect_success HAVE_JQ 'confirm job-list stats show zero inactive jobs' '
test $(inactive_count job-list-stats) -eq 0
'
test_expect_success 'reconfigure job manager with incorrect type limit' '
cat >config/system.toml <<-EOT &&
[job-manager]
Expand Down

0 comments on commit 4ca4c93

Please sign in to comment.