Whamcloud - gitweb
LU-15403 tests: fix some false alarm 58/45958/2
authorAlexey Lyashkov <alexey.lyashkov@hpe.com>
Thu, 30 Dec 2021 13:04:59 +0000 (16:04 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 26 Jan 2022 05:13:58 +0000 (05:13 +0000)
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 <alexey.lyashkov@hpe.com>
Change-Id: I59d6e5deb79ca9f040385231738b8698a3309e8e
Reviewed-on: https://review.whamcloud.com/45958
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 64cbe5c..6d96f85 100755 (executable)
@@ -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
 }