Whamcloud - gitweb
EX-6826 tests: wait before unmounting pcc device if busy
authorLei Feng <flei@whamcloud.com>
Tue, 11 Jul 2023 03:13:01 +0000 (11:13 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sun, 16 Jul 2023 23:10:31 +0000 (23:10 +0000)
wait at most 10 seconds before unmounting pcc device
if it is busy.

Signed-off-by: Lei Feng <flei@whamcloud.com>
Test-Parameters: trivial testlist=sanity-pcc env=ONLY=25,ONLY_REPEAT=100
Change-Id: I77ec018d33d14af99bdc5d5c5c94c8fa0dafdb61
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/51623
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/sanity-pcc.sh

index 8063372..064501c 100644 (file)
@@ -193,8 +193,18 @@ umount_loopdev() {
        local facet=$1
        local mntpt=$2
        local rc
+       local i
+
+       for ((i = 0; i < 10; i++)); do
+               if do_facet $facet lsof $mntpt; then
+                       echo "$mntpt is busy, wait 1 second..."
+                       sleep 1
+               else
+                       echo "$mntpt is idle now"
+                       break
+               fi
+       done
 
-       do_facet $facet lsof $mntpt || true
        do_facet $facet $UMOUNT $mntpt
        rc=$?
        return $rc