Skip to content

Commit

Permalink
t: move some tests towards end of tests
Browse files Browse the repository at this point in the history
Problem: The testing of stats clearing in the KVS is done
a little bit before the end of a set of tests.  This can be
inconvenient for future tests that do not wish stats to be cleared.

Move the clearing of stats tests towards the end of tests in
t1001-kvs-internals.t.
  • Loading branch information
chu11 committed Jan 21, 2025
1 parent af7a42b commit 4a18a1e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/modules/kvs/kvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2448,7 +2448,7 @@ static void stats_get_cb (flux_t *h,
"{ s:O s:O s:{s:O s:O} s:i }",
"cache", cstats,
"namespace", nsstats,
"transactions",
"transaction-opcount",
"commit", txncstats,
"fence", txnfstats,
"pending_requests", zhashx_size (ctx->requests)) < 0)
Expand Down
60 changes: 30 additions & 30 deletions t/t1001-kvs-internals.t
Original file line number Diff line number Diff line change
Expand Up @@ -461,36 +461,6 @@ test_expect_success 'kvs: read-your-writes consistency on alt namespace' '
flux kvs namespace remove rywtestns
'

#
# test clear of stats
#

# each store of largeval will increase the noop store count, b/c we
# know that the identical large value will be cached as raw data

test_expect_success 'kvs: clear stats locally' '
flux kvs unlink -Rf $DIR &&
flux module stats -c kvs &&
flux module stats --parse "namespace.primary.#no-op stores" kvs | grep -q 0 &&
flux kvs put $DIR.largeval1=$largeval &&
flux kvs put $DIR.largeval2=$largeval &&
! flux module stats --parse "namespace.primary.#no-op stores" kvs | grep -q 0 &&
flux module stats -c kvs &&
flux module stats --parse "namespace.primary.#no-op stores" kvs | grep -q 0
'

test_expect_success NO_ASAN 'kvs: clear stats globally' '
flux kvs unlink -Rf $DIR &&
flux module stats -C kvs &&
flux exec -n sh -c "flux module stats --parse \"namespace.primary.#no-op stores\" kvs | grep -q 0" &&
for i in `seq 0 $((${SIZE} - 1))`; do
flux exec -n -r $i sh -c "flux kvs put $DIR.$i.largeval1=$largeval $DIR.$i.largeval2=$largeval"
done &&
! flux exec -n sh -c "flux module stats --parse \"namespace.primary.#no-op stores\" kvs | grep -q 0" &&
flux module stats -C kvs &&
flux exec -n sh -c "flux module stats --parse \"namespace.primary.#no-op stores\" kvs | grep -q 0"
'

#
# test fence api
#
Expand Down Expand Up @@ -534,6 +504,36 @@ test_expect_success 'kvs: 1 pending requests at end of tests before module remov
test $pendingcount1 -eq 1
'

#
# test clear of stats
#

# each store of largeval will increase the noop store count, b/c we
# know that the identical large value will be cached as raw data

test_expect_success 'kvs: clear stats locally' '
flux kvs unlink -Rf $DIR &&
flux module stats -c kvs &&
flux module stats --parse "namespace.primary.#no-op stores" kvs | grep -q 0 &&
flux kvs put $DIR.largeval1=$largeval &&
flux kvs put $DIR.largeval2=$largeval &&
! flux module stats --parse "namespace.primary.#no-op stores" kvs | grep -q 0 &&
flux module stats -c kvs &&
flux module stats --parse "namespace.primary.#no-op stores" kvs | grep -q 0
'

test_expect_success NO_ASAN 'kvs: clear stats globally' '
flux kvs unlink -Rf $DIR &&
flux module stats -C kvs &&
flux exec -n sh -c "flux module stats --parse \"namespace.primary.#no-op stores\" kvs | grep -q 0" &&
for i in `seq 0 $((${SIZE} - 1))`; do
flux exec -n -r $i sh -c "flux kvs put $DIR.$i.largeval1=$largeval $DIR.$i.largeval2=$largeval"
done &&
! flux exec -n sh -c "flux module stats --parse \"namespace.primary.#no-op stores\" kvs | grep -q 0" &&
flux module stats -C kvs &&
flux exec -n sh -c "flux module stats --parse \"namespace.primary.#no-op stores\" kvs | grep -q 0"
'

#
# test ENOSYS on unfinished requests when unloading the KVS module
#
Expand Down

0 comments on commit 4a18a1e

Please sign in to comment.