Whamcloud - gitweb
LU-5079 tests: fix service_time in max_recovery_time()
[fs/lustre-release.git] / lustre / tests / replay-dual.sh
index 3bc1b6c..1a12cd5 100755 (executable)
@@ -254,23 +254,25 @@ test_10() {
 run_test 10 "resending a replayed unlink"
 
 test_11() {
-    replay_barrier $SINGLEMDS
-    mcreate $MOUNT1/$tfile-1
-    mcreate $MOUNT2/$tfile-2
-    mcreate $MOUNT1/$tfile-3
-    mcreate $MOUNT2/$tfile-4
-    mcreate $MOUNT1/$tfile-5
-    # drop all reint replies for a while
-    do_facet $SINGLEMDS lctl set_param fail_loc=0x0119
-    # note that with this fail_loc set, facet_failover df will fail
-    facet_failover $SINGLEMDS
-    #sleep for while, let both clients reconnect and timeout
-    sleep $((TIMEOUT * 2))
-    do_facet $SINGLEMDS lctl set_param fail_loc=0
+       replay_barrier $SINGLEMDS
+       mcreate $MOUNT1/$tfile-1
+       mcreate $MOUNT2/$tfile-2
+       mcreate $MOUNT1/$tfile-3
+       mcreate $MOUNT2/$tfile-4
+       mcreate $MOUNT1/$tfile-5
+       # drop all reint replies for a while
+       do_facet $SINGLEMDS $LCTL set_param fail_loc=0x0119
+       # note that with this fail_loc set, facet_failover df will fail
+       facet_failover $SINGLEMDS
 
-    rm $MOUNT1/$tfile-[1-5] || return 1
+       local clients=${CLIENTS:-$HOSTNAME}
+       wait_clients_import_state "$clients" $SINGLEMDS FULL
 
-    return 0
+       do_facet $SINGLEMDS $LCTL set_param fail_loc=0
+
+       rm $MOUNT1/$tfile-[1-5] || return 1
+
+       return 0
 }
 run_test 11 "both clients timeout during replay"
 
@@ -485,9 +487,10 @@ test_20() { #16389
     rm $MOUNT1/a
     zconf_mount `hostname` $MOUNT2 || error "mount $MOUNT2 fail"
     TIER2=$((`date +%s` - BEFORE))
-    [ $TIER2 -ge $((TIER1 * 2)) ] && \
-        error "recovery time is growing $TIER2 > $TIER1"
-    return 0
+
+       [[ $TIER2 -ge $((TIER1 * 2 + (TIER1 >> 2))) ]] &&
+               error "recovery time is growing $TIER2 > $TIER1"
+       return 0
 }
 run_test 20 "recovery time is not increasing"