Skip to content

Commit 2f21b16

Browse files
behlendorftonyhutter
authored andcommitted
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
1 parent e54eef2 commit 2f21b16

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

tests/zfs-tests/tests/functional/cli_root/zfs_share/zfs_share_concurrent_shares.ksh

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,26 @@ function test_share # filesystem
9898

9999
zfs set sharenfs=on $filesystem || \
100100
sub_fail "zfs set sharenfs=on $filesystem failed."
101-
is_shared $mntp || \
102-
sub_fail "File system $filesystem is not shared (set sharenfs)."
103101

104102
#
105-
# Verify 'zfs share' works as well.
103+
# Verify 'zfs share' results in a shared mount. We check this
104+
# multiple times because of Fedora 37+ it's been observed in
105+
# the CI that the share may not be immediately reported.
106+
#
107+
for retry in $(seq 1 10); do
108+
is_shared $mntp && break
109+
110+
log_note "Wait $retry / 10 for is_shared $mntp (set sharenfs)"
111+
112+
if [[ $retry -eq 10 ]]; then
113+
sub_fail "File system $filesystem is not shared (set sharenfs)."
114+
fi
115+
116+
sleep 1
117+
done
118+
119+
#
120+
# Verify 'zfs unshare' works as well.
106121
#
107122
zfs unshare $filesystem || \
108123
sub_fail "zfs unshare $filesystem failed."
@@ -112,9 +127,23 @@ function test_share # filesystem
112127

113128
zfs share $filesystem || \
114129
sub_fail "zfs share $filesystem failed."
115-
is_shared $mntp || \
116-
sub_fail "file system $filesystem is not shared (zfs share)."
117130

131+
#
132+
# Verify 'zfs share' results in a shared mount. We check this
133+
# multiple times because of Fedora 37+ it's been observed in
134+
# the CI that the share may not be immediately reported.
135+
#
136+
for retry in $(seq 1 10); do
137+
is_shared $mntp && break
138+
139+
log_note "Wait $retry / 10 for is_shared $mntp (zfs share)"
140+
141+
if [[ $retry -eq 10 ]]; then
142+
sub_fail "File system $filesystem is not shared (zfs share)."
143+
fi
144+
145+
sleep 1
146+
done
118147

119148
#log_note "Sharing a shared file system fails."
120149
zfs share $filesystem && \

0 commit comments

Comments
 (0)