Fix datasets held open after tests

Fix for post-testing error:

`cannot destroy 'tmp.uwIwWzoNp4/tmp': dataset is busy`

Thanks to @nalind for the fix.

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich 2023-04-04 10:47:59 -04:00
parent 1ad45ee2e2
commit 224f0b93d2
No known key found for this signature in database
GPG Key ID: 03EDC70FD578067F
1 changed files with 2 additions and 0 deletions

View File

@ -70,6 +70,8 @@ case $TEST_DRIVER in
trap "zfs destroy -Rf $zpool/tmp; zpool destroy -f $zpool; rm -f $tmpfile" EXIT
zfs create $zpool/tmp
TMPDIR="/$zpool/tmp" showrun make STORAGE_DRIVER=$TEST_DRIVER local-test-integration local-test-unit
# Ensure no datasets are held open prior to `zfs destroy` trap.
kill $(lsns -J -t mnt --output-all | jq '.namespaces[]|select(.command=="sleep 1000s").pid')
;;
*)
die "Unknown/Unsupported \$TEST_DRIVER=$TEST_DRIVER (see .cirrus.yml and $(basename $0))"