Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix flakiness of 'bazel test' #502

Merged
merged 4 commits into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_closure",
sha256 = "319e5e0127a83436b55588877a9d81464c2780c0dffc809065cf299d772670f5",
strip_prefix = "rules_closure-87d24b1df8b62405de8dd059cb604fd9d4b1e395",
sha256 = "1f8d2e169bb292ef2adbe563bd66d5b8d4b462b6b869a67647e771ecef4b5030",
strip_prefix = "rules_closure-a176ec89a1b251bb5442ba569d47cee3c053e633",
urls = [
"https://github.com/bazelbuild/rules_closure/archive/87d24b1df8b62405de8dd059cb604fd9d4b1e395.zip",
"https://github.com/bazelbuild/rules_closure/archive/a176ec89a1b251bb5442ba569d47cee3c053e633.zip",
],
)

Expand Down
29 changes: 7 additions & 22 deletions scripts/kokoro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ BAZEL_FILES=$(find "${REPO_DIR}" \
-not -path "${REPO_DIR}/third_party/*" -and \
\( -name "BUILD.bazel" -o -name "*.bzl" \))
./buildifier -mode check ${BAZEL_FILES[@]}
rm ./buildifier

# These programs need to be already installed
progs=(docker docker-compose bazel npm curl)
progs=(docker docker-compose npm curl)
for p in "${progs[@]}"
do
command -v "$p" > /dev/null 2>&1 || \
Expand All @@ -48,28 +49,12 @@ BAZEL_VERSION=0.23.1
wget https://github.com/bazelbuild/bazel/releases/download/"${BAZEL_VERSION}"/bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh
chmod +x ./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh
./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh --user
$HOME/bin/bazel version

# 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
$HOME/bin/bazel version
$HOME/bin/bazel clean
$HOME/bin/bazel test \
Yannic marked this conversation as resolved.
Show resolved Hide resolved
//javascript/net/grpc/web/... \
//net/grpc/gateway/examples/...

# Build the grpc-web npm package
cd packages/grpc-web && \
Expand Down