From: henrique Date: Wed, 30 Apr 2014 16:11:11 +0000 (+0200) Subject: more consistent timing on test.sh X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=d5aba4c13b808156b17959f955c194d938a61227;p=common%2Fthrift.git more consistent timing on test.sh --- diff --git a/test/test.sh b/test/test.sh index 0247e31e..43ec8835 100755 --- a/test/test.sh +++ b/test/test.sh @@ -29,7 +29,6 @@ cd "$( dirname "$0" )" BASEDIR=$(pwd) - print_header() { printf "%-16s %-11s %-17s %-s\n" "client-server:" "protocol:" "transport:" "result:" } @@ -56,7 +55,7 @@ do_test () { server_startup_time=$7 testname=${client_server}_${protocol}_${transport} - server_timeout=$((${server_startup_time}+${client_timeout})) + server_timeout=$(echo "(${server_startup_time}+${client_timeout})" | bc) printf "%-16s %-11s %-17s" ${client_server} ${protocol} ${transport} timeout $server_timeout $server_exec > log/${testname}_server.log 2>&1 & @@ -125,9 +124,9 @@ for proto in $java_protocols; do "ip-ssl" ) extraparam="--ssl";; esac do_test "java-java" "${proto}" "${trans}-${sock}" \ - "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" testclient" \ - "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" testserver" \ - "10" "2" + "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testclient" \ + "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testserver" \ + "5" "1" done done done @@ -144,7 +143,7 @@ for proto in $cpp_protocols; do do_test "cpp-cpp" "${proto}" "${trans}-${sock}" \ "cpp/TestClient --protocol=${proto} --transport=${trans} ${extraparam}" \ "cpp/TestServer --protocol=${proto} --transport=${trans} ${extraparam}" \ - "2" "1" + "2" "0.1" done done done @@ -160,9 +159,9 @@ for proto in $(intersection "${java_protocols}" "${cpp_protocols}"); do "ip-ssl" ) extraparam="--ssl";; esac do_test "java-cpp" "${proto}" "${trans}-${sock}" \ - "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" testclient" \ + "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testclient" \ "cpp/TestServer --protocol=${proto} --transport=${trans} ${extraparam}"\ - "10" "1" + "5" "0.1" done done done @@ -177,8 +176,8 @@ for proto in $(intersection "${cpp_protocols}" "${java_protocols}"); do esac do_test "cpp-java" "${proto}" "${trans}-${sock}" \ "cpp/TestClient --protocol=${proto} --transport=${trans} ${extraparam}" \ - "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" testserver" \ - "1" "2" + "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=${proto} --transport=${trans} ${extraparam}\" run-testserver" \ + "5" "1" done done done @@ -186,6 +185,7 @@ done NODE_TEST_DIR=${BASEDIR}/../lib/nodejs/test export NODE_PATH=${NODE_TEST_DIR}:${NODE_TEST_DIR}/../lib:${NODE_PATH} + ######### nodejs client - cpp server ############## ## for proto in $(intersection "${nodejs_protocols}" "${cpp_protocols}"); do @@ -198,7 +198,7 @@ for proto in $(intersection "${nodejs_protocols}" "${cpp_protocols}"); do do_test "nodejs-cpp" "${proto}" "${trans}-${sock}" \ "node ${NODE_TEST_DIR}/client.js -p ${proto} -t ${trans} ${extraparam}" \ "cpp/TestServer --protocol=${proto} --transport=${trans} ${extraparam}" \ - "2" "1" + "5" "0.2" done done done @@ -214,7 +214,7 @@ for proto in $(intersection "${nodejs_protocols}" "${cpp_protocols}"); do do_test "cpp-nodejs" "${proto}" "${trans}-${sock}" \ "cpp/TestClient --protocol=${proto} --transport=${trans} ${extraparam}" \ "node ${NODE_TEST_DIR}/server.js -p ${proto} -t ${trans} ${extraparam}" \ - "2" "1" + "5" "2" done done done @@ -234,7 +234,7 @@ for proto in $csharp_protocols; do do_test "csharp-csharp" "${proto}" "${trans}-${sock}" \ "../lib/csharp/test/ThriftTest/TestClientServer.exe client --protocol=${proto} --transport=${trans} ${extraparam}" \ "../lib/csharp/test/ThriftTest/TestClientServer.exe server --protocol=${proto} --transport=${trans} ${extraparam}" \ - "5" "5" + "5" "1" done done done @@ -243,35 +243,35 @@ done do_test "py-py" "binary" "buffered-ip" \ "py/TestClient.py --proto=binary --port=9090 --host=localhost --genpydir=py/gen-py" \ "py/TestServer.py --proto=binary --port=9090 --genpydir=py/gen-py TSimpleServer" \ - "2" "2" + "10" "2" do_test "py-py" "json" "buffered-ip" \ "py/TestClient.py --proto=json --port=9090 --host=localhost --genpydir=py/gen-py" \ "py/TestServer.py --proto=json --port=9090 --genpydir=py/gen-py TSimpleServer" \ - "2" "2" + "10" "2" do_test "py-cpp" "binary" "buffered-ip" \ "py/TestClient.py --proto=binary --port=9090 --host=localhost --genpydir=py/gen-py" \ "cpp/TestServer" \ - "2" "2" + "10" "2" do_test "py-cpp" "json" "buffered-ip" \ "py/TestClient.py --proto=json --port=9090 --host=localhost --genpydir=py/gen-py" \ "cpp/TestServer --protocol=json" \ - "2" "2" + "10" "2" do_test "cpp-py" "binary" "buffered-ip" \ "cpp/TestClient --protocol=binary --port=9090" \ "py/TestServer.py --proto=binary --port=9090 --genpydir=py/gen-py TSimpleServer" \ - "2" "2" + "10" "2" do_test "cpp-py" "json" "buffered-ip" \ "cpp/TestClient --protocol=json --port=9090" \ "py/TestServer.py --proto=json --port=9090 --genpydir=py/gen-py TSimpleServer" \ - "2" "2" + "10" "2" do_test "py-java" "binary" "buffered-ip" \ "py/TestClient.py --proto=binary --port=9090 --host=localhost --genpydir=py/gen-py" \ "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" run-testserver" \ - "2" "2" + "15" "2" do_test "py-java" "json" "buffered-ip" \ "py/TestClient.py --proto=json --port=9090 --host=localhost --genpydir=py/gen-py" \ "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" -Dtestargs \"--protocol=json\" run-testserver" \ - "2" "2" + "15" "2" do_test "java-py" "binary" "buffered-ip" \ "ant -f ../lib/java/build.xml -Dno-gen-thrift=\"\" run-testclient" \ "py/TestServer.py --proto=binary --port=9090 --genpydir=py/gen-py TSimpleServer" \ @@ -283,11 +283,11 @@ do_test "js-java" "json " "http-ip" \ do_test "perl-cpp" "binary" "buffered-ip" \ "perl -I perl/gen-perl/ -I../lib/perl/lib/ perl/TestClient.pl" \ "cpp/TestServer" \ - "10" "5" + "10" "2" do_test "php-cpp" "binary" "buffered-ip" \ "make -C php/ client" \ "cpp/TestServer" \ - "10" "5" + "10" "2" do_test "rb-rb" "binary" "buffered-ip" \ "ruby rb/integration/simple_client.rb" \ "ruby rb/integration/simple_server.rb" \