[PATCH] tests: wait for up to 5 seconds for start-up, not just 3s

Jim Meyering jim at meyering.net
Wed Dec 15 21:08:30 UTC 2010


FYI, when running tests via valgrind wrappers, I'd get
false-positive failures due to the increased start-up delay.
Using 5s instead of 3s is thus merely a band-aid (still won't
be enough on a heavily loaded system), but at least for now,
it's good enough.

>From df00ac3954bf66d4f6026f6dc787514f6e76a96c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Fri, 10 Dec 2010 21:34:54 +0100
Subject: [PATCH] tests: wait for up to 5 seconds for start-up, not just 3s

* t/replication: When running via valgrind wrappers,
3 seconds was not enough.
* t/basic: Likewise.
---
 t/basic       |    9 ++++-----
 t/replication |    4 ++--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/t/basic b/t/basic
index 3d610d9..6a30fcc 100644
--- a/t/basic
+++ b/t/basic
@@ -20,8 +20,8 @@ mongod --port $m_port --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1
 mongo_pid=$!
 cleanup_() { kill -9 $mongo_pid; }

-# Wait for up to 3 seconds for mongod to begin listening.
-wait_for .1 30 'mongo localhost:$m_port < /dev/null' \
+# Wait for up to 5 seconds for mongod to begin listening.
+wait_for .1 50 'mongo localhost:$m_port < /dev/null' \
   || framework_failure_ mongod failed to start

 port=9091
@@ -137,8 +137,8 @@ iwhd -v -p $port -c iwhd.cfg -d localhost:$m_port &
 iwhd_pid=$!
 cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }

-# Wait for up to 3 seconds for iwhd to begin listening on $port.
-wait_for .1 30 "curl -s http://localhost:$port" \
+# Wait for up to 5 seconds for iwhd to begin listening on $port.
+wait_for .1 50 "curl -s http://localhost:$port" \
   || { echo iwhd failed to listen; Exit 1; }

 # Create an empty bucket.
@@ -257,7 +257,6 @@ for i in xml json; do

 done

-
 # Add a single attribute to an object using the PUT method.
 bucket=$bucket
 printf nothing | curl -T - $bucket/attr_put || fail=1
diff --git a/t/replication b/t/replication
index 74423f2..835fa68 100644
--- a/t/replication
+++ b/t/replication
@@ -33,7 +33,7 @@ EOF
 port=9092
 iwhd -v -p $port -c iwhd_u.cfg -d localhost:$m_port &
 iwhd_pid=$!
-wait_for .1 30 "curl http://localhost:$port" \
+wait_for .1 50 "curl http://localhost:$port" \
 	|| framework_failure_ "iwhd upstream"
 cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid; }

@@ -46,7 +46,7 @@ EOF
 d_port=9093
 iwhd -v -p $d_port -c iwhd_d.cfg -d localhost:$m_port -m localhost:$port &
 iwhd_d_pid=$!
-wait_for .1 30 "curl http://localhost:$d_port" \
+wait_for .1 50 "curl http://localhost:$d_port" \
 	|| framework_failure_ "iwhd downstream"
 cleanup_() { kill -9 $mongo_pid; kill $iwhd_pid $iwhd_d_pid; }

--
1.7.3.3.26.g4b5f


More information about the iwhd-devel mailing list