summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/end-to-end/just-mr/just-mr.test.sh7
-rw-r--r--test/other_tools/utils/curl_usage_test.sh7
2 files changed, 12 insertions, 2 deletions
diff --git a/test/end-to-end/just-mr/just-mr.test.sh b/test/end-to-end/just-mr/just-mr.test.sh
index d82e5309..251c5d36 100644
--- a/test/end-to-end/just-mr/just-mr.test.sh
+++ b/test/end-to-end/just-mr/just-mr.test.sh
@@ -98,12 +98,17 @@ python3 -u "${ROOT}/utils/run_test_server.py" "${port_file}" & server_pid=$!
# set up cleanup of http server
trap "server_cleanup ${server_pid}" INT TERM EXIT
# wait for the server to be available
-while [ -z "$(cat "${port_file}")" ]
+tries=0
+while [ -z "$(cat "${port_file}")" ] && [ $tries -lt 10 ]
do
+ tries=$((${tries}+1))
sleep 1s
done
# get port number as variable
port_num="$(cat ${port_file})"
+if [ -z "${port_num}" ]; then
+ exit 1
+fi
echo "Create local build env"
# the build root
diff --git a/test/other_tools/utils/curl_usage_test.sh b/test/other_tools/utils/curl_usage_test.sh
index 8db9e675..6791365d 100644
--- a/test/other_tools/utils/curl_usage_test.sh
+++ b/test/other_tools/utils/curl_usage_test.sh
@@ -43,10 +43,15 @@ python3 -u "${ROOT}/utils/run_test_server.py" "${port_file}" & server_pid=$!
# set up cleanup of http server
trap "server_cleanup ${server_pid}" INT TERM EXIT
# wait for the server to be available
-while [ -z "$(cat "${port_file}")" ]
+tries=0
+while [ -z "$(cat "${port_file}")" ] && [ $tries -lt 10 ]
do
+ tries=$((${tries}+1))
sleep 1s
done
+if [ -z "$(cat ${port_file})" ]; then
+ exit 1
+fi
cd "${ROOT}"