Skip to content

Commit

Permalink
Merge pull request #1291 from chu11/issue1287
Browse files Browse the repository at this point in the history
kvs: Add stats.clear test coverage
  • Loading branch information
garlick authored Nov 22, 2017
2 parents 3c3890c + d5c3b23 commit a2b1063
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions t/t1001-kvs-internals.t
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,34 @@ test_expect_success 'kvs: unlink on rank 0, does not exist all ranks' '
flux exec sh -c "flux kvs wait ${VERS} && ! flux kvs get --json $DIR.xxx"
'

#
# 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 kvs | grep no-op | grep -q 0 &&
flux kvs put --json $DIR.largeval1=$largeval &&
flux kvs put --json $DIR.largeval2=$largeval &&
! flux module stats kvs | grep no-op | grep -q 0 &&
flux module stats -c kvs &&
flux module stats kvs | grep no-op | grep -q 0
'

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

test_done
2 changes: 1 addition & 1 deletion t/t2000-wreck.t
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ test_expect_success 'flux-wreck: attach with stdin' '
EOF
test_cmp output.attach_in expected.attach_in
'
test_expect_success 'flux-werck: attach --label-io' '
test_expect_success 'flux-wreck: attach --label-io' '
flux wreckrun -l -n4 --output=expected.attach-l echo bazz >/dev/null &&
flux wreck attach --label-io $(last_job_id) |sort > output.attach-l &&
sort expected.attach-l > x && mv x expected.attach-l &&
Expand Down

0 comments on commit a2b1063

Please sign in to comment.