mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
wait for server to be running instead of naive sleep.
This commit is contained in:
committed by
David Glasser
parent
b2b5e323eb
commit
db59ab13c1
@@ -23,7 +23,22 @@ pkill -f "$PROJDIR/.meteor/local/db" || true
|
||||
../../../meteor --production --settings "scenarios/${SCENARIO}.json" --port 9000 &
|
||||
OUTER_PID=$!
|
||||
|
||||
echo "Waiting for server to come up"
|
||||
function wait_for_port {
|
||||
local N=0
|
||||
while ! curl -v "$1" 2>&1 | grep ' 200 ' > /dev/null ; do
|
||||
sleep 1
|
||||
N=$(($N+1))
|
||||
if [ $N -ge $2 ] ; then
|
||||
echo "Timed out waiting for port $1"
|
||||
exit 2
|
||||
fi
|
||||
done
|
||||
}
|
||||
wait_for_port "http://localhost:9001" 60
|
||||
|
||||
|
||||
echo "Starting phantoms"
|
||||
# start a bunch of phantomjs processes
|
||||
PHANTOMSCRIPT=`mktemp -t benchmark-XXXXXXXX`
|
||||
cat > "$PHANTOMSCRIPT" <<EOF
|
||||
|
||||
Reference in New Issue
Block a user