Skip to content

Commit 4302b8d

Browse files
committed
t: add kvs pending_requests stat test
Problem: There are no tests to ensure the new kvs "pending_requests" stat is working. Add some tests to t1001-kvs-internals.t.
1 parent 555d966 commit 4302b8d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/t1001-kvs-internals.t

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ test_kvs_key() {
2626
test_cmp expected output
2727
}
2828

29+
#
30+
# pending request stats are 0 at start of tests
31+
#
32+
33+
test_expect_success 'kvs: no pending requests at start of tests' '
34+
pendingcount=$(flux module stats -p pending_requests kvs) &&
35+
test $pendingcount -eq 0
36+
'
37+
2938
#
3039
# large value test
3140
#
@@ -533,13 +542,17 @@ wait_versionwaiters() {
533542
534543
# In order to test, wait for a version that will not happen
535544
test_expect_success NO_CHAIN_LINT 'kvs: ENOSYS returned on unfinished requests on module unload' '
545+
pendingcount=$(flux module stats -p pending_requests kvs) &&
546+
pendingcountexp=$(($pendingcount+1)) &&
536547
WAITCOUNT=$(flux module stats --parse namespace.primary.#versionwaiters kvs) &&
537548
WAITCOUNT=$(($WAITCOUNT+1))
538549
VERS=$(flux kvs version) &&
539550
VERSWAIT=$(($VERS+10)) &&
540551
flux kvs wait ${VERSWAIT} 2> enosys.err &
541552
pid=$! &&
542553
wait_versionwaiters ${WAITCOUNT} &&
554+
newcount=$(flux module stats -p pending_requests kvs) &&
555+
test $pendingcountexp -eq $newcount &&
543556
flux module remove kvs &&
544557
! wait $pid &&
545558
grep "Function not implemented" enosys.err

0 commit comments

Comments
 (0)