Whamcloud - gitweb
LU-12747 tests: wait properly for orhpan thread stop 95/37395/2
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 1 Feb 2020 00:55:23 +0000 (17:55 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Feb 2020 05:51:04 +0000 (05:51 +0000)
Use wait_update_facet() to check if the MDD orphan cleanup thread has
exited, rather than a fixed 5s timeout.  We can hope that most cases
will finish faster than 5s, but don't gratuitously fail if it takes
somewhat longer.  We clearly aren't having a fatal problem here, or
there would be serious failures at cleanup time.

Fixes: fffef5c29e3b ("LU-11418 mdd: delete name if orphan doesn't exist")
Test-Parameters: trivial testlist=sanity envdefinitions=ONLY=811,ONLY_REPEAT=100
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I16b0281a519d47b5b98d495bf17040153c3ebbe5
Reviewed-on: https://review.whamcloud.com/37395
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: James Nunez <jnunez@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity.sh

index 5ad991c..8ac8138 100755 (executable)
@@ -22681,8 +22681,7 @@ test_811() {
        stop mds1
        start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS
 
        stop mds1
        start mds1 $(mdsdevname 1) $MDS_MOUNT_OPTS
 
-       sleep 5
-       [[ $(do_facet mds1 pgrep orph_.*-MDD | wc -l) -eq 0 ]] ||
+       wait_update_facet mds1 "pgrep orph_.*-MDD | wc -l" "0" ||
                error "MDD orphan cleanup thread not quit"
 }
 run_test 811 "orphan name stub can be cleaned up in startup"
                error "MDD orphan cleanup thread not quit"
 }
 run_test 811 "orphan name stub can be cleaned up in startup"