Whamcloud - gitweb
LU-6029 test: add wrap up duration in conf-sanity test_84 87/13087/4
authorDmitry Eremin <dmitry.eremin@intel.com>
Tue, 16 Dec 2014 15:05:48 +0000 (18:05 +0300)
committerAndreas Dilger <andreas.dilger@intel.com>
Wed, 17 Dec 2014 20:36:53 +0000 (20:36 +0000)
The time of execution the function target_finish_recovery() can be
very long but "obd->obd_recovery_end = cfs_time_current_sec();" set
at the end. Therefore the recovery time always will be more than
hard limit and depends how long target_finish_recovery() function
was executed.

To avoid instability in test_84 just add 5 seconds as wrap up time.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I53263f9a248429f59741f701fcc7b5b6d693325e
Reviewed-on: http://review.whamcloud.com/13087
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Sergey Cheremencev <sergey_cheremencev@xyratex.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/tests/conf-sanity.sh

index 6f864fd..006798d 100644 (file)
@@ -5250,17 +5250,17 @@ test_84() {
        local time_min=$(recovery_time_min)
        local recovery_duration
        local completed_clients
+       local wrap_up=5
 
-       echo "start mds service on `facet_active_host $facet`"
+       echo "start mds service on $(facet_active_host $facet)"
        start $facet ${dev} $MDS_MOUNT_OPTS \
-               "-o recovery_time_hard=$time_min,recovery_time_soft=$time_min"\
-               $@ || return 94
+           "-o recovery_time_hard=$time_min,recovery_time_soft=$time_min" $@ ||
+               error "start MDS failed"
 
        start_ost
        start_ost2
 
-       echo "recovery_time_hard $time_min, recovery_time_soft $time_min, \
-               timeout $TIMEOUT"
+       echo "recovery_time=$time_min, timeout=$TIMEOUT, wrap_up=$wrap_up"
 
        mount_client $MOUNT1 || error "mount failed"
        mount_client $MOUNT2 || error "mount failed"
@@ -5271,26 +5271,25 @@ test_84() {
        # We need to catch the end of recovery window to extend it.
        # Skip 5 requests and add delay to request handling.
        #define OBD_FAIL_TGT_REPLAY_DELAY  0x709 | FAIL_SKIP
-       do_facet $SINGLEMDS "lctl set_param fail_loc=0x20000709"
-       do_facet $SINGLEMDS "lctl set_param fail_val=5"
+       do_facet $SINGLEMDS "lctl set_param fail_loc=0x20000709 fail_val=5"
 
        facet_failover $SINGLEMDS || error "failover: $?"
        client_up
 
        echo "recovery status"
-       do_facet $SINGLEMDS "$LCTL get_param -n \
-                               mdt.$FSNAME-MDT0000.recovery_status"
-
-       recovery_duration=$(do_facet $SINGLEMDS "$LCTL get_param -n \
-                               mdt.$FSNAME-MDT0000.recovery_status" | \
-                               grep recovery_duration |awk '{print $2}')
-       (($recovery_duration>$time_min)) && \
-               error "recovery_duration > recovery_time_hard"
-       completed_clients=$(do_facet $SINGLEMDS "$LCTL get_param -n \
-                               mdt.$FSNAME-MDT0000.recovery_status" | \
-                               grep completed_clients |awk '{print $2}')
-       [ "$completed_clients" = "1/2" ] || \
-               error "completed_clients != 1/2: "$completed_clients
+       do_facet $SINGLEMDS \
+               "$LCTL get_param -n mdt.$FSNAME-MDT0000.recovery_status"
+
+       recovery_duration=$(do_facet $SINGLEMDS \
+               "$LCTL get_param -n mdt.$FSNAME-MDT0000.recovery_status" |
+               awk '/recovery_duration/ { print $2 }')
+       (( $recovery_duration > $time_min + $wrap_up )) &&
+               error "recovery_duration > recovery_time_hard + wrap up"
+       completed_clients=$(do_facet $SINGLEMDS \
+               "$LCTL get_param -n mdt.$FSNAME-MDT0000.recovery_status" |
+               awk '/completed_clients/ { print $2 }')
+       [ "$completed_clients" = "1/2" ] ||
+               error "completed_clients != 1/2: $completed_clients"
 
        do_facet $SINGLEMDS "lctl set_param fail_loc=0"
        umount_client $MOUNT1