From f364d542aaf272c14b1d6ef7c9ac805db0fdb45c Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Fri, 5 Apr 2013 16:26:53 -0700 Subject: tests: fix dependency on sleep in bug-874498.t With the introduction of http://review.gluster.org/4784, there are delays which breaks bug-874498.t which wrongly depends on healing to finish within 2 seconds. Fix this by using 'EXPECT_WITHIN 60' instead of sleep 2. Change-Id: I2716d156c977614c719665a5e1f159dabf2878b5 BUG: 874498 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/4796 Reviewed-by: Jeff Darcy Tested-by: Gluster Build System --- tests/bugs/bug-874498.t | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/bugs/bug-874498.t b/tests/bugs/bug-874498.t index 35430f1ad..469a0e3a4 100644 --- a/tests/bugs/bug-874498.t +++ b/tests/bugs/bug-874498.t @@ -45,20 +45,26 @@ done EXPECT "3" echo $count +function count_entries() +{ + val1=0 +##count the number of entries after self heal + for g in `ls $1` + do + val1=$(( val1 + 1 )) + done + + echo $val1; +} + TEST $CLI volume start $V0 force sleep 5 TEST $CLI volume heal $V0 full -sleep 2 -val1=0 -##count the number of entries after self heal -for g in `ls $FILEN` -do -val1=$(( val1 + 1 )) -done ##Expected number of entries are 0 in the .glusterfs/indices/xattrop directory -EXPECT '0' echo $val1 +EXPECT_WITHIN 60 '0' count_entries $FILEN; + TEST $CLI volume stop $V0; TEST $CLI volume delete $V0; -- cgit