When approaching quota limit, client turns to sync write, then the
tests which assume io can be finished quickly could fail, we need
to enlarge the time margin to make sure those tests can pass on slow
system.
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Ib14a905344eb78cdbd0cd79e3bfd8e50ab21a4d8
Reviewed-on: http://review.whamcloud.com/5539
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
# block soft limit
test_3() {
local LIMIT=1 # 1MB
# block soft limit
test_3() {
local LIMIT=1 # 1MB
local TESTFILE=$DIR/$tdir/$tfile-0
set_ost_qtype "ug" || error "enable ost quota failed"
local TESTFILE=$DIR/$tdir/$tfile-0
set_ost_qtype "ug" || error "enable ost quota failed"
# write should continue & succeed
local count=0
# write should continue & succeed
local count=0
+ local o_size=$(stat -c %s $TESTFILE)
+ local c_size
while [ true ]; do
if ! ps -p ${DDPID} > /dev/null 2>&1; then break; fi
while [ true ]; do
if ! ps -p ${DDPID} > /dev/null 2>&1; then break; fi
- if [ $count -ge 120 ]; then
+ if [ $count -ge 240 ]; then
quota_error u $TSTUSR "dd not finished in $count secs"
fi
count=$((count + 1))
quota_error u $TSTUSR "dd not finished in $count secs"
fi
count=$((count + 1))
- [ $((count % 10)) -eq 0 ] && echo "Waiting $count secs"
+ if [ $((count % 30)) -eq 0 ]; then
+ c_size=$(stat -c %s $TESTFILE)
+ if [ $c_size -eq $o_size ]; then
+ quota_error u $TSTUSR "file not growed" \
+ "in 30 seconds $o_size/$c_size"
+ else
+ echo "Waiting $count secs. $o_size/$c_size"
+ o_size=$c_size
+ fi
+ fi