From d10d218d6ad5ea7f3e38584d1af79f1a276d94cd Mon Sep 17 00:00:00 2001 From: tianzy Date: Mon, 10 Mar 2008 09:28:50 +0000 Subject: [PATCH] Branch b1_6 improve test_18 and test_18a in sanity-quota.sh b=14840 i=adilger i=johann --- lustre/ldlm/ldlm_lib.c | 2 +- lustre/tests/sanity-quota.sh | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index f002733..de4c8dc 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1666,7 +1666,7 @@ int target_handle_dqacq_callback(struct ptlrpc_request *req) } /* Block the quota req. b=14840 */ - OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_BLOCK_QUOTA_REQ,OBD_TIMEOUT_DEFAULT); + OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_BLOCK_QUOTA_REQ, obd_timeout); rc = ptlrpc_reply(req); out: diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 7049eaa..d6dff8b 100644 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -1337,16 +1337,17 @@ test_18() { echo " step2: testing ......" count=0 + timeout=$(sysctl -n lustre.timeout) while [ true ]; do if [ -z `ps -ef | awk '$2 == '${DDPID}' { print $8 }'` ]; then break; fi count=$[count+1] - if [ $count -gt 200 ]; then - error "dd should be finished!" + if [ $count -gt $((2 * $timeout)) ]; then + error "count=$count dd should be finished!" fi sleep 1 done - log -n "(dd_pid=$DDPID, time=$count)" - if [ $count -lt 90 ]; then + log "(dd_pid=$DDPID, time=$count, timeout=$timeout)" + if [ $count -lt $(($timeout - 10)) ]; then error " should take longer!" else echo " successful" @@ -1388,17 +1389,18 @@ test_18a() { echo " step2: testing ......" count=0 + timeout=$(sysctl -n lustre.timeout) while [ true ]; do if [ -z `ps -ef | awk '$2 == '${DDPID}' { print $8 }'` ]; then break; fi count=$[count+1] - if [ $count -gt 200 ]; then + if [ $count -gt $((3 * $timeout)) ]; then lustre_fail mds 0 - error "dd should be finished!" + error "count=$count dd should be finished!" fi sleep 1 done - log -n "(dd_pid=$DDPID, time=$count)" - if [ $count -lt 90 ]; then + log "(dd_pid=$DDPID, time=$count, timeout=$timeout)" + if [ $count -lt $(($timeout - 10)) ]; then lustre_fail mds 0 error " should take longer!" else -- 1.8.3.1