Whamcloud - gitweb
LU-9560 tests: sanity test_801a sleeps more time 88/27288/4
authorFan Yong <fan.yong@intel.com>
Fri, 26 May 2017 03:09:32 +0000 (11:09 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 3 Jun 2017 03:59:44 +0000 (03:59 +0000)
If the barrier_freeze thread sleep time is too short, then
it is possible that before the barrier_stat thread scheduled,
the barrier_freeze thread has gone through phase "freezing_p1",
that will cause test failure.

This patch makes the barrier_freeze thread to sleep more long
time, then the barrier_stat thread can check its status properly.

Test-Parameters: trivial
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Iebbc05a1d86553b484bd7093f147e5ac4b58e199
Reviewed-on: https://review.whamcloud.com/27288
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/tests/sanity.sh

index a436192..9f4fa37 100755 (executable)
@@ -16389,13 +16389,15 @@ post_801() {
 test_801a() {
        prep_801
 
 test_801a() {
        prep_801
 
+       echo "Start barrier_freeze at: $(date)"
        #define OBD_FAIL_BARRIER_DELAY          0x2202
        #define OBD_FAIL_BARRIER_DELAY          0x2202
-       do_facet mgs $LCTL set_param fail_val=3 fail_loc=0x2202
+       do_facet mgs $LCTL set_param fail_val=5 fail_loc=0x2202
        do_facet mgs $LCTL barrier_freeze $FSNAME 10 &
 
        do_facet mgs $LCTL barrier_freeze $FSNAME 10 &
 
-       sleep 1
+       sleep 2
        local b_status=$(do_facet mgs $LCTL barrier_stat $FSNAME |
                               awk '/The barrier for/ { print $7 }')
        local b_status=$(do_facet mgs $LCTL barrier_stat $FSNAME |
                               awk '/The barrier for/ { print $7 }')
+       echo "Got barrier status at: $(date)"
        [ "$b_status" = "'freezing_p1'" ] ||
                error "(1) unexpected barrier status $b_status"
 
        [ "$b_status" = "'freezing_p1'" ] ||
                error "(1) unexpected barrier status $b_status"
 
@@ -16424,13 +16426,15 @@ test_801a() {
        [ "$b_status" = "'frozen'" ] ||
                error "(5) unexpected barrier status $b_status"
 
        [ "$b_status" = "'frozen'" ] ||
                error "(5) unexpected barrier status $b_status"
 
+       echo "Start barrier_thaw at: $(date)"
        #define OBD_FAIL_BARRIER_DELAY          0x2202
        #define OBD_FAIL_BARRIER_DELAY          0x2202
-       do_facet mgs $LCTL set_param fail_val=3 fail_loc=0x2202
+       do_facet mgs $LCTL set_param fail_val=5 fail_loc=0x2202
        do_facet mgs $LCTL barrier_thaw $FSNAME &
 
        do_facet mgs $LCTL barrier_thaw $FSNAME &
 
-       sleep 1
+       sleep 2
        b_status=$(do_facet mgs $LCTL barrier_stat $FSNAME |
                         awk '/The barrier for/ { print $7 }')
        b_status=$(do_facet mgs $LCTL barrier_stat $FSNAME |
                         awk '/The barrier for/ { print $7 }')
+       echo "Got barrier status at: $(date)"
        [ "$b_status" = "'thawing'" ] ||
                error "(6) unexpected barrier status $b_status"
 
        [ "$b_status" = "'thawing'" ] ||
                error "(6) unexpected barrier status $b_status"