From: Nathaniel Clark Date: Tue, 30 Apr 2013 19:33:21 +0000 (-0400) Subject: LU-3089 tests: Give ZFS more time to complete dd's X-Git-Tag: 2.4.1-RC1~78 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b0cb083cb7b0d40e593a1b5d3243b26d87574d18;p=fs%2Flustre-release.git LU-3089 tests: Give ZFS more time to complete dd's Due to LU-2887 and ilk, give zfs more time to do disk transfers. Also cleanup test formatting. Signed-off-by: Nathaniel Clark Change-Id: Ia22f2244ccec552046d2efeaeaa6e2194547c96c Reviewed-on: http://review.whamcloud.com/6217 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index be0c6a1..18cfcc0 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -1060,57 +1060,58 @@ test_55() { mkdir -p $DIR/$tdir + # Minimum pass speed is 2MBps + local ddtimeout=64 + # LU-2887/LU-3089 - set min pass speed to 500KBps + [ "$(facet_fstype ost1)" = "zfs" ] && ddtimeout=256 + # first dd should be finished quickly $LFS setstripe -c 1 -i 0 $DIR/$tdir/$tfile-1 - dd if=/dev/zero of=$DIR/$tdir/$tfile-1 bs=32M count=4 & + dd if=/dev/zero of=$DIR/$tdir/$tfile-1 bs=32M count=4 & DDPID=$! count=0 echo "step1: testing ......" - while [ true ]; do - if [ -z `ps x | awk '$1 == '$DDPID' { print $5 }'` ]; then break; fi - count=$[count+1] - if [ $count -gt 64 ]; then - error "dd should be finished!" - fi - sleep 1 - done + while kill -0 $DDPID 2> /dev/null; do + let count++ + if [ $count -gt $ddtimeout ]; then + error "dd should be finished!" + fi + sleep 1 + done echo "(dd_pid=$DDPID, time=$count)successful" $LFS setstripe -c 1 -i 0 $DIR/$tdir/$tfile-2 #define OBD_FAIL_OST_DROP_REQ 0x21d do_facet ost1 lctl set_param fail_loc=0x0000021d # second dd will be never finished - dd if=/dev/zero of=$DIR/$tdir/$tfile-2 bs=32M count=4 & + dd if=/dev/zero of=$DIR/$tdir/$tfile-2 bs=32M count=4 & DDPID=$! count=0 echo "step2: testing ......" - while [ $count -le 64 ]; do - dd_name="`ps x | awk '$1 == '$DDPID' { print $5 }'`" - if [ -z $dd_name ]; then - ls -l $DIR/$tdir - echo "debug: (dd_name=$dd_name, dd_pid=$DDPID, time=$count)" - error "dd shouldn't be finished!" - fi - count=$[count+1] - sleep 1 - done + while [ $count -le $ddtimeout ]; do + if ! kill -0 $DDPID 2> /dev/null; then + ls -l $DIR/$tdir + error "dd shouldn't be finished! (time=$count)" + fi + let count++ + sleep 1 + done echo "(dd_pid=$DDPID, time=$count)successful" #Recover fail_loc and dd will finish soon do_facet ost1 lctl set_param fail_loc=0 count=0 echo "step3: testing ......" - while [ true ]; do - if [ -z `ps x | awk '$1 == '$DDPID' { print $5 }'` ]; then break; fi - count=$[count+1] - if [ $count -gt 500 ]; then - error "dd should be finished!" - fi - sleep 1 - done + while kill -0 $DDPID 2> /dev/null; do + let count++ + if [ $count -gt $((ddtimeout + 440)) ]; then + error "dd should be finished!" + fi + sleep 1 + done echo "(dd_pid=$DDPID, time=$count)successful" - rm -rf $DIR/$tdir + rm -rf $DIR/$tdir } run_test 55 "ost_brw_read/write drops timed-out read/write request"