[sheepdog] [PATCH v2] tests/050: fix a supurious failure

Liu Yuan namei.unix at gmail.com
Thu Feb 7 07:48:32 CET 2013


From: Liu Yuan <tailai.ly at taobao.com>

For a fast CPU which can write 100M to memory far less than 1 second, we cannot
sleep before iptable tricks and the logger might not flush the log yet before we
grep it so we need safely sleep for 1 second.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 tests/050 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/050 b/tests/050
index 3fa2fca..6837446 100755
--- a/tests/050
+++ b/tests/050
@@ -34,13 +34,14 @@ $COLLIE cluster format
 $COLLIE vdi create test 100M
 dd if=/dev/zero | $COLLIE vdi write test &
 
-sleep 1
 # simulate IO NIC down of sheep 1
 iptables -A INPUT -p tcp --sport 8001 -j DROP
 iptables -A INPUT -p tcp --dport 8001 -j DROP
 
 # wait for collie to finish
 wait
+# Logger flush in 1 second internval. We need assure log is flushed.
+sleep 1
 
 if [ "`grep fallback $STORE/0/sheep.log`" ];then
 	echo fallback done
-- 
1.7.9.5




More information about the sheepdog mailing list