From ee4b86f2ec68ebcaa3db94ec314b256de3531e8e Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 27 Jun 2013 00:33:37 +0300 Subject: [PATCH] Now waits at max 20 seconds for webrick to wake up properly --- modules/remotebackend/testrunner.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/remotebackend/testrunner.sh b/modules/remotebackend/testrunner.sh index 7f687a5caf..3238e7fb99 100755 --- a/modules/remotebackend/testrunner.sh +++ b/modules/remotebackend/testrunner.sh @@ -6,7 +6,13 @@ function start_web() { if [ x"$REMOTEBACKEND_HTTP" == "xyes" ]; then ./unittest_$1.rb & webrick_pid=$! - sleep 1 + loopcount=0 + while [ $loopcount -lt 20 ]; do + res=$(curl http://localhost:62434/ping 2>/dev/null) + if [ "x$res" == "xpong" ]; then break; fi + sleep 1 + let loopcount=loopcount+1 + done fi } @@ -50,7 +56,7 @@ case "$mode" in stop_web ;; *) - echo "Usage: $0 test_remotebackend_(pipe|http|post)" + echo "Usage: $0 test_remotebackend_(pipe|http|post|json)" ;; esac -- 2.47.3