From 84c571acb99bc8dff99c925e8afd589ef7e2a5bb Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 9 Sep 2013 11:04:34 +0200 Subject: [PATCH] run-tests: fix MongoDB start wait There's actually 2 lines that matches the current rule: [websvr] admin web console waiting for connections on port 30000 [initandlisten] waiting for connections on port 29000 Let's make it more tighten. Related-Bug: #1218488 Change-Id: I4ba56a7c2406a9851aa8087b4cabb0aa31698763 --- run-tests.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 23f64e6ab..e1bec0296 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -23,18 +23,19 @@ fi # Main unit tests MONGO_DATA=`mktemp -d /tmp/CEILO-MONGODB-XXXXX` +MONGO_PORT=29000 trap "clean_exit" EXIT mkfifo ${MONGO_DATA}/out export PATH=${PATH:+$PATH:}/sbin:/usr/sbin -mongod --maxConns 32 --nojournal --noprealloc --smallfiles --quiet --noauth --port 29000 --dbpath "${MONGO_DATA}" --bind_ip localhost &>${MONGO_DATA}/out & +mongod --maxConns 32 --nojournal --noprealloc --smallfiles --quiet --noauth --port ${MONGO_PORT} --dbpath "${MONGO_DATA}" --bind_ip localhost &>${MONGO_DATA}/out & MONGO_PID=$! # Wait for Mongo to start listening to connections while read line do - echo "$line" | grep -q 'waiting for connections on port' && break + echo "$line" | grep -q "waiting for connections on port ${MONGO_PORT}" && break done < ${MONGO_DATA}/out # Read the fifo for ever otherwise mongod would block # + that gives us the log on screen cat ${MONGO_DATA}/out > /dev/null & -export CEILOMETER_TEST_MONGODB_URL="mongodb://localhost:29000/ceilometer" +export CEILOMETER_TEST_MONGODB_URL="mongodb://localhost:${MONGO_PORT}/ceilometer" python setup.py testr --slowest --testr-args="$*" $COVERAGE_ARG