Whamcloud - gitweb
LU-7812 tests: address race condition for sanity:120{e,f} 11/24811/6
authorJinshan Xiong <jinshan.xiong@intel.com>
Wed, 11 Jan 2017 02:07:19 +0000 (18:07 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 17 Jan 2017 17:31:23 +0000 (17:31 +0000)
By adding a delay between lock cancel and stat, it can avoid the
problem that the locks are still held by ldlm lock thread while
'cancel_lru_locks osc' is called.

Test-Parameters: trivial envdefinitions="ONLY=120e" testlist=sanity,sanity,sanity,sanity,sanity,sanity,sanity,sanity,sanity,sanity
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I2095cb1df05ff45c2671edaed5a61bcdd4a56266
Reviewed-on: https://review.whamcloud.com/24811
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity.sh

index 776eb0e..1654625 100755 (executable)
@@ -8339,6 +8339,7 @@ test_120e() {
        stat $DIR/$tdir $DIR/$tdir/f1 > /dev/null
        # XXX client can not do early lock cancel of OST lock
        # during unlink (LU-4206), so cancel osc lock now.
+       sleep 2
        cancel_lru_locks osc
        can1=$(do_facet $SINGLEMDS \
               "$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |
@@ -8381,6 +8382,7 @@ test_120f() {
        stat $DIR/$tdir/d1 $DIR/$tdir/d2 $DIR/$tdir/d1/f1 $DIR/$tdir/d2/f2 > /dev/null
        # XXX client can not do early lock cancel of OST lock
        # during rename (LU-4206), so cancel osc lock now.
+       sleep 2
        cancel_lru_locks osc
        can1=$(do_facet $SINGLEMDS \
               "$LCTL get_param -n ldlm.services.ldlm_canceld.stats" |