From a626ed1efa713eb6dd6a3577c70fd9bd0d6353ab Mon Sep 17 00:00:00 2001 From: Lei Feng Date: Tue, 11 Jul 2023 11:13:01 +0800 Subject: [PATCH] EX-6826 tests: wait before unmounting pcc device if busy wait at most 10 seconds before unmounting pcc device if it is busy. Signed-off-by: Lei Feng 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 Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/tests/sanity-pcc.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lustre/tests/sanity-pcc.sh b/lustre/tests/sanity-pcc.sh index 8063372..064501c 100644 --- a/lustre/tests/sanity-pcc.sh +++ b/lustre/tests/sanity-pcc.sh @@ -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 -- 1.8.3.1