[sheepdog] [PATCH] tests/functional: use _wait_for_sheep to make sure that sheep starts

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Jul 24 12:11:54 CEST 2013


This fixes a false alarm of zk tests on my environment.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 tests/functional/001 | 3 ++-
 tests/functional/002 | 3 ++-
 tests/functional/003 | 3 ++-
 tests/functional/004 | 3 ++-
 tests/functional/005 | 4 +++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/tests/functional/001 b/tests/functional/001
index b06c13a..1dd4ed8 100755
--- a/tests/functional/001
+++ b/tests/functional/001
@@ -41,7 +41,8 @@ done
 
 for i in 0 1 2; do
     _start_sheep $i
-    sleep 1
+    nr=$(($nr + 1))
+    _wait_for_sheep $nr 0
 done
 
 _wait_for_sheep 3
diff --git a/tests/functional/002 b/tests/functional/002
index a649b27..45b89ac 100755
--- a/tests/functional/002
+++ b/tests/functional/002
@@ -35,7 +35,8 @@ done
 # master transfer will happen once
 for i in 1 0 2; do
     _start_sheep $i
-    sleep 1
+    nr=$(($nr + 1))
+    _wait_for_sheep $nr 1
 done
 
 _wait_for_sheep 3
diff --git a/tests/functional/003 b/tests/functional/003
index 31c8abf..55c1a81 100755
--- a/tests/functional/003
+++ b/tests/functional/003
@@ -34,7 +34,8 @@ done
 # master transfer will happen twice
 for i in 0 1 2; do
     _start_sheep $i
-    sleep 1
+    nr=$(($nr + 1))
+    _wait_for_sheep $nr 0
 done
 
 _wait_for_sheep 3
diff --git a/tests/functional/004 b/tests/functional/004
index ece9aa3..363e5e8 100755
--- a/tests/functional/004
+++ b/tests/functional/004
@@ -42,7 +42,8 @@ done
 
 for i in 0 1 2 3 4; do
     _start_sheep $i
-    sleep 1
+    nr=$(($nr + 1))
+    _wait_for_sheep $nr 0
 done
 
 _wait_for_sheep 5
diff --git a/tests/functional/005 b/tests/functional/005
index fc055f9..85500a8 100755
--- a/tests/functional/005
+++ b/tests/functional/005
@@ -36,9 +36,11 @@ _wait_for_sheep 2 4
 $COLLIE cluster shutdown -p 7004
 _wait_for_sheep_stop
 
+nr=0
 for i in 0 1 2 3 4; do
     _start_sheep $i
-    sleep 1
+    nr=$(($nr + 1))
+    _wait_for_sheep $nr 0
 done
 
 _wait_for_sheep 5
-- 
1.8.1.3.566.gaa39828




More information about the sheepdog mailing list