Skip to content
Snippets Groups Projects
Commit 851f5919 authored by Donna Dionne's avatar Donna Dionne
Browse files

Adding timeout for each test run so that failed tests do not block the running...

Adding timeout for each test run so that failed tests do not block the running of the rest of the tests.
parent bff9f495
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
thisfile=$(readlink -ne "${BASH_SOURCE[0]}")
run_test() {
local test_case=$1
shift
local client=$1
shift
local server=$1
if grpc_interop_test $test_case grpc-docker-testclients $client grpc-docker-server $server
then
echo "$test_case $client $server passed" >> /tmp/interop_result.txt
else
echo "$test_case $client $server failed" >> /tmp/interop_result.txt
fi
}
time_out() {
local test_case=$1
shift
local client=$1
shift
local server=$1
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
if ! timeout 20s bash -l -c "source $thisfile && run_test $test_case $client $server"
then
echo "$test_case $client $server timed out" >> /tmp/interop_result.txt
fi
fi
}
main() {
source grpc_docker.sh
......@@ -11,17 +40,14 @@ main() {
do
for server in "${servers[@]}"
do
if grpc_interop_test $test_case grpc-docker-testclients $client grpc-docker-server $server
then
echo "$test_case $client $server passed" >> /tmp/interop_result.txt
else
echo "$test_case $client $server failed" >> /tmp/interop_result.txt
fi
time_out $test_case $client $server
done
done
done
gsutil cp /tmp/interop_result.txt gs://stoked-keyword-656-output/interop_result.txt
rm /tmp/interop_result.txt
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
gsutil cp /tmp/interop_result.txt gs://stoked-keyword-656-output/interop_result.txt
rm /tmp/interop_result.txt
fi
}
set -x
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment