File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ will generally cover non-obvious issues/features that a general user
99would be unaware of.
1010'
1111
12+ . ` dirname $0 ` /kvs/kvs-helper.sh
13+
1214. ` dirname $0 ` /sharness.sh
1315
1416# Size the session to one more than the number of cores, minimum of 4
@@ -511,4 +513,36 @@ test_expect_success 'kvs: test invalid lookup rpc' '
511513 grep "flux_future_get: Protocol error" lookup_invalid_output
512514'
513515
516+ #
517+ # test ENOSYS on unfinished requests when unloading the KVS module
518+ #
519+ # N.B. do this last as we are unloading the kvs module
520+ #
521+
522+ wait_versionwaiters () {
523+ num=$1
524+ i=0
525+ while [ " $( flux module stats --parse namespace.primary.# versionwaiters kvs 2> /dev/null)" != "${num}" ] \
526+ && [ $i -lt ${KVS_WAIT_ITERS} ]
527+ do
528+ sleep 0.1
529+ i=$(( i + 1 ))
530+ done
531+ return $( loophandlereturn $i )
532+ }
533+
534+ # In order to test, wait for a version that will not happen
535+ test_expect_success NO_CHAIN_LINT ' kvs: ENOSYS returned on unfinished requests on module unload' '
536+ WAITCOUNT=$(flux module stats --parse namespace.primary.#versionwaiters kvs) &&
537+ WAITCOUNT=$(($WAITCOUNT+1))
538+ VERS=$(flux kvs version) &&
539+ VERSWAIT=$(($VERS+10)) &&
540+ flux kvs wait ${VERSWAIT} 2> enosys.err &
541+ pid=$! &&
542+ wait_versionwaiters ${WAITCOUNT} &&
543+ flux module remove kvs &&
544+ ! wait $pid &&
545+ grep "Function not implemented" enosys.err
546+ '
547+
514548test_done
You can’t perform that action at this time.
0 commit comments