aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2023-10-10 13:32:33 -0700
committerBrian Behlendorf <[email protected]>2023-10-10 19:19:09 -0700
commitd7b6e470ff4b84ee503085036094e0a499af9cd9 (patch)
tree306dcb1dd9c9e8bdfb50184d6cbc76d3205a921f
parent04186d33be72b8cdb539f1428682b7d3ca3f7b5e (diff)
ZTS: Debug zfs_share_concurrent_shares failure
Update zfs_share_concurrent_shares test case to wait a few seconds and recheck that the filesystem isn't shared. The intent here is determine the nature of the error and if it may be a race. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Umer Saleem <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #15379
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh39
1 files changed, 34 insertions, 5 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh
index c226f56e3..d779689f8 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh
@@ -98,11 +98,26 @@ function test_share # filesystem
zfs set sharenfs=on $filesystem || \
sub_fail "zfs set sharenfs=on $filesystem failed."
- is_shared $mntp || \
- sub_fail "File system $filesystem is not shared (set sharenfs)."
#
- # Verify 'zfs share' works as well.
+ # Verify 'zfs share' results in a shared mount. We check this
+ # multiple times because of Fedora 37+ it's been observed in
+ # the CI that the share may not be immediately reported.
+ #
+ for retry in $(seq 1 10); do
+ is_shared $mntp && break
+
+ log_note "Wait $retry / 10 for is_shared $mntp (set sharenfs)"
+
+ if [[ $retry -eq 10 ]]; then
+ sub_fail "File system $filesystem is not shared (set sharenfs)."
+ fi
+
+ sleep 1
+ done
+
+ #
+ # Verify 'zfs unshare' works as well.
#
zfs unshare $filesystem || \
sub_fail "zfs unshare $filesystem failed."
@@ -112,9 +127,23 @@ function test_share # filesystem
zfs share $filesystem || \
sub_fail "zfs share $filesystem failed."
- is_shared $mntp || \
- sub_fail "file system $filesystem is not shared (zfs share)."
+ #
+ # Verify 'zfs share' results in a shared mount. We check this
+ # multiple times because of Fedora 37+ it's been observed in
+ # the CI that the share may not be immediately reported.
+ #
+ for retry in $(seq 1 10); do
+ is_shared $mntp && break
+
+ log_note "Wait $retry / 10 for is_shared $mntp (zfs share)"
+
+ if [[ $retry -eq 10 ]]; then
+ sub_fail "File system $filesystem is not shared (zfs share)."
+ fi
+
+ sleep 1
+ done
#log_note "Sharing a shared file system fails."
zfs share $filesystem && \