test: wait_for_examine and delay in reap_unregistered_poller.sh

We need to give the thread library some time to reap
the unregistered poller - it is a bit of a delayed
process.  We have to wait for examine to finish on
the aio bdev, then the poll group gets destroyed and
the pollers unregistered.  This marks the pollers as
UNREGISTERED, but they aren't actually reaped until
next time the thread is polled.

Fixes issue #2980.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I1e32c50ea9b28ea2d5560ddc9b2f68fa81e708d9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17575
Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Mike Gerdts <mgerdts@nvidia.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Jim Harris 2023-04-14 01:19:36 +00:00
parent 72672d4982
commit 0fa85da9c4

View File

@ -8,6 +8,9 @@ rootdir=$(readlink -f $testdir/../..)
source $rootdir/test/common/autotest_common.sh
source $testdir/interrupt_common.sh
# This test script makes sure that unregistered pollers are
# reaped correctly when the target is running in interrupt mode.
export PYTHONPATH=$PYTHONPATH:$rootdir/examples/interrupt_tgt
# Set reactors with intr_tgt in intr mode
@ -24,6 +27,12 @@ native_pollers+=$(jq -r '.timed_pollers[].name' <<< $app_thread)
# pollers like bdev_aio_group_poll poller, and then unregister it.
setup_bdev_aio
# Wait for examine to finish, and then sleep a very short amount of
# time to allow the unregistered pollers to get reaped next time
# the spdk_threads are polled
"$rpc_py" bdev_wait_for_examine
sleep 0.1
# Record names of remaining pollers.
app_thread=$(rpc_cmd thread_get_pollers | jq -r '.threads[0]')
remaining_pollers=$(jq -r '.active_pollers[].name' <<< $app_thread)