Skip to content

Commit 176eea4

Browse files
committed
t: check pending requests at end of kvs tests
Problem: Now that the KVS tracks pending requests, it would be easy to introduce an error in the future where pending requests are not tracked correctly. Ensure that pending requests are 0 (or the expected number) at the end of each kvs test file.
1 parent 4302b8d commit 176eea4

10 files changed

+86
-0
lines changed

t/t1000-kvs.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,15 @@ test_expect_success 'setroot-unpause request with empty payload fails with EPROT
12731273
${RPC} kvs.setroot-unpause 71 </dev/null
12741274
'
12751275

1276+
#
1277+
# ensure no lingering pending requests
1278+
#
1279+
1280+
test_expect_success 'kvs: no pending requests at end of tests before module removal' '
1281+
pendingcount=$(flux module stats -p pending_requests kvs) &&
1282+
test $pendingcount -eq 0
1283+
'
1284+
12761285
#
12771286
# module corner cases
12781287
#

t/t1001-kvs-internals.t

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,18 @@ test_expect_success 'kvs: test invalid lookup rpc' '
522522
grep "flux_future_get: Protocol error" lookup_invalid_output
523523
'
524524

525+
#
526+
# ensure pending requests are the expected number
527+
#
528+
529+
# fence invalid tests above linger a pending request on both rank 0 and rank 1
530+
test_expect_success 'kvs: 1 pending requests at end of tests before module removal' '
531+
pendingcount=$(flux module stats -p pending_requests kvs) &&
532+
test $pendingcount -eq 1 &&
533+
pendingcount1=$(flux exec -n -r 1 sh -c "flux module stats -p pending_requests kvs") &&
534+
test $pendingcount1 -eq 1
535+
'
536+
525537
#
526538
# test ENOSYS on unfinished requests when unloading the KVS module
527539
#

t/t1003-kvs-stress.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,13 @@ test_expect_success 'kvs: transaction-merge disabling works' '
123123
test "$OUTPUT" = "${THREADS}"
124124
'
125125

126+
#
127+
# ensure no lingering pending requests
128+
#
129+
130+
test_expect_success 'kvs: no pending requests at end of tests' '
131+
pendingcount=$(flux module stats -p pending_requests kvs) &&
132+
test $pendingcount -eq 0
133+
'
134+
126135
test_done

t/t1004-kvs-namespace.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,4 +546,13 @@ test_expect_success NO_CHAIN_LINT 'kvs: wait in different namespaces works' '
546546
test_expect_code 0 wait $testkvswaitpid
547547
'
548548
549+
#
550+
# ensure no lingering pending requests
551+
#
552+
553+
test_expect_success 'kvs: no pending requests at end of tests' '
554+
pendingcount=$(flux module stats -p pending_requests kvs) &&
555+
test $pendingcount -eq 0
556+
'
557+
549558
test_done

t/t1005-kvs-security.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,4 +433,13 @@ test_expect_success 'kvs: stats clear fails (user)' '
433433
unset_userid
434434
'
435435

436+
#
437+
# ensure no lingering pending requests
438+
#
439+
440+
test_expect_success 'kvs: no pending requests at end of tests' '
441+
pendingcount=$(flux module stats -p pending_requests kvs) &&
442+
test $pendingcount -eq 0
443+
'
444+
436445
test_done

t/t1007-kvs-lookup-watch.t

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,4 +670,14 @@ test_expect_success 'kvs-watch.lookup request non-streaming fails with EPROTO(71
670670
echo "{\"namespace\":"foo", \"key\":\"bar\", \"flags\":4}" \
671671
${RPC} kvs-watch.lookup 71
672672
'
673+
674+
#
675+
# ensure no lingering pending requests
676+
#
677+
678+
test_expect_success 'kvs: no pending requests at end of tests' '
679+
pendingcount=$(flux module stats -p pending_requests kvs) &&
680+
test $pendingcount -eq 0
681+
'
682+
673683
test_done

t/t1008-kvs-eventlog.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,13 @@ test_expect_success 'flux kvs eventlog wait-event fails on bad input' '
236236
test_must_fail flux kvs eventlog wait-event
237237
'
238238

239+
#
240+
# ensure no lingering pending requests
241+
#
242+
243+
test_expect_success 'kvs: no pending requests at end of tests' '
244+
pendingcount=$(flux module stats -p pending_requests kvs) &&
245+
test $pendingcount -eq 0
246+
'
247+
239248
test_done

t/t1009-kvs-copy.t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,4 +187,13 @@ test_expect_success 'kvs-move nonexistent dst namespace fails' '
187187
test_must_fail flux kvs move --dst-namespace=nons test.foo test.foo
188188
'
189189

190+
#
191+
# ensure no lingering pending requests
192+
#
193+
194+
test_expect_success 'kvs: no pending requests at end of tests' '
195+
pendingcount=$(flux module stats -p pending_requests kvs) &&
196+
test $pendingcount -eq 0
197+
'
198+
190199
test_done

t/t1010-kvs-commit-sync.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ test_expect_success 'kvs: sync without backing store fails' '
7777
test_must_fail flux kvs put --sync d=4
7878
'
7979

80+
test_expect_success 'kvs: no pending requests at end of tests before module removal' '
81+
pendingcount=$(flux module stats -p pending_requests kvs) &&
82+
test $pendingcount -eq 0
83+
'
84+
8085
test_expect_success 'kvs: unload kvs' '
8186
flux module remove kvs
8287
'

t/t1011-kvs-checkpoint-period.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ test_expect_success 'kvs: checkpoint of kvs-primary should change in time (4)' '
156156
test_cmp checkpoint5.out blob5.out
157157
'
158158

159+
test_expect_success 'kvs: no pending requests at end of tests before module removal' '
160+
pendingcount=$(flux module stats -p pending_requests kvs) &&
161+
test $pendingcount -eq 0
162+
'
163+
159164
test_expect_success 'kvs: remove modules' '
160165
flux module remove kvs &&
161166
flux module remove content-sqlite &&

0 commit comments

Comments
 (0)