From: Alexey Lyashkov Date: Thu, 30 Dec 2021 13:04:59 +0000 (+0300) Subject: LU-15403 tests: fix some false alarm X-Git-Tag: 2.15.0-RC1~67 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=ed31c0cf4b09f4b877f79970de258008307e59bc;p=fs%2Flustre-release.git LU-15403 tests: fix some false alarm Current test implementation have a two bugs. 1) client mgc llogs processing is async to mount, so we can start a lock check before all locks processed. it caused a false alarm. Same story with several client mounts. 2) Server locks counting is unsafe, as it include an other server locks. so any servers reconnect may cause a false alarm. Let's fix it. HPe-bug-id: LUS-8326 Test-Parameters: trivial testlist=sanityn Signed-off-by: Alexey Lyashkov Change-Id: I59d6e5deb79ca9f040385231738b8698a3309e8e Reviewed-on: https://review.whamcloud.com/45958 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andrew Perepechko Reviewed-by: Sergey Cheremencev Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 64cbe5c..6d96f85 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -27970,6 +27970,8 @@ run_test 900 "umount should not race with any mgc requeue thread" # LUS-6253/LU-11185 test_901() { + local old + local count local oldc local newc local olds @@ -27978,16 +27980,28 @@ test_901() { # some get_param have a bug to handle dot in param name cancel_lru_locks MGC - oldc=$($LCTL get_param -n 'ldlm.namespaces.MGC*.lock_count') - olds=$(do_facet mgs $LCTL get_param -n 'ldlm.namespaces.MGS*.lock_count') + old=$(mount -t lustre | wc -l) + # 1 config+sptlrpc + # 2 params + # 3 nodemap + # 4 IR + old=$((old * 4)) + oldc=0 + count=0 + while [ $old -ne $oldc ]; do + oldc=$($LCTL get_param -n 'ldlm.namespaces.MGC*.lock_count') + sleep 1 + ((count++)) + if [ $count -ge $TIMEOUT ]; then + error "too large timeout" + fi + done umount_client $MOUNT || error "umount failed" mount_client $MOUNT || error "mount failed" cancel_lru_locks MGC newc=$($LCTL get_param -n 'ldlm.namespaces.MGC*.lock_count') - news=$(do_facet mgs $LCTL get_param -n 'ldlm.namespaces.MGS*.lock_count') [ $oldc -lt $newc ] && error "mgc lock leak ($oldc != $newc)" - [ $olds -lt $news ] && error "mgs lock leak ($olds != $news)" return 0 }