Parallel tests

Jeff Darcy jdarcy at redhat.com
Tue Oct 5 21:21:50 UTC 2010


I looked into this a bit after it came up on IRC.  The reason it's
failing is that the two mongod instances are using the same port.
They're also using the same directory, which I think is *a* problem but
not *the* problem.  In any case, here's a diff (on top of my
replication-test patch) which shows how to make things behave.

diff --git a/t/replication b/t/replication
index 7f311e7..5299a71 100644
--- a/t/replication
+++ b/t/replication
@@ -3,11 +3,11 @@

 . "${srcdir=.}/init.sh"; path_prepend_ ..

-mkdir mongod fs_upstream fs_downstream || framework_failure_ mkdir failed
+mkdir mongod2 fs_upstream fs_downstream || framework_failure_ mkdir failed

 # FIXME: start this only if there's not a working one already running, or
 # probably better, start this one unconditionally and make iwhd use it.
-mongod --pidfilepath mongod/pid --dbpath mongod > mongod.log 2>&1 &
+mongod --port 27018 --dbpath mongod2 > mongod.log 2>&1 &
 mongo_pid=$!
 cleanup_() { kill $mongo_pid; sleep 3; }

@@ -24,7 +24,7 @@ cat > iwhd_u.cfg << EOF
 EOF

 port=9092
-iwhd -v -p $port -c iwhd_u.cfg &
+iwhd -v -p $port -c iwhd_u.cfg -d localhost:27018 &
 iwhd_pid=$!
 wait_for .1 30 "curl http://localhost:$port" \
        || framework_failure_ "iwhd upstream"
@@ -37,7 +37,7 @@ cat > iwhd_d.cfg << EOF
 EOF

 d_port=9093
-iwhd -v -p $d_port -c iwhd_d.cfg &
+iwhd -v -p $d_port -c iwhd_d.cfg -d localhost:27018 &
 iwhd_d_pid=$!
 wait_for .1 30 "curl http://localhost:$d_port" \
        || framework_failure_ "iwhd downstream"


More information about the iwhd-devel mailing list