From ef94d2e7e0b866be9822eff22c56b089e64e870b Mon Sep 17 00:00:00 2001 From: Stanley Cheung Date: Wed, 20 Mar 2019 00:09:40 -0700 Subject: [PATCH] Temporarily run bazel test multiple times --- scripts/kokoro.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/scripts/kokoro.sh b/scripts/kokoro.sh index 0b01a60..fee58d1 100755 --- a/scripts/kokoro.sh +++ b/scripts/kokoro.sh @@ -49,9 +49,26 @@ wget https://github.com/bazelbuild/bazel/releases/download/"${BAZEL_VERSION}"/ba chmod +x ./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh ./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh --user $HOME/bin/bazel version -$HOME/bin/bazel test \ - //javascript/net/grpc/web/... \ - //net/grpc/gateway/examples/... + +# Run the bazel test command multiple times because of some flaky +# behavior with libssl.so +tries=15 +set +e +for ((i=1;i<=$tries;i++)); +do + $HOME/bin/bazel clean + $HOME/bin/bazel test --cache_test_results=no \ + //javascript/net/grpc/web/... \ + //net/grpc/gateway/examples/... + ret=$? + if [ $ret -eq 0 ]; then + break + elif [ $i -eq $tries ]; then + exit 1 + fi +done +set -e +rm ./buildifier rm ./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh # Build the grpc-web npm package