From 224f0b93d28c846922165bb2e71218bce219cbe3 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 4 Apr 2023 10:47:59 -0400 Subject: [PATCH] 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 --- contrib/cirrus/build_and_test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/cirrus/build_and_test.sh b/contrib/cirrus/build_and_test.sh index 03b47bd4e9..8b1f3ad108 100755 --- a/contrib/cirrus/build_and_test.sh +++ b/contrib/cirrus/build_and_test.sh @@ -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))"