fix bazel wrapper download race in sanity tests

pull/21929/head
Jan Tattermusch 5 years ago
parent 543d8796f0
commit 2945f9b0a3
  1. 18
      tools/bazel
  2. 5
      tools/run_tests/run_tests.py

@ -24,12 +24,20 @@
set -e
# First of all, if DISABLE_BAZEL_WRAPPER is set, just use BAZEL_REAL as set by
# https://github.com/bazelbuild/bazel/blob/master/scripts/packages/bazel.sh
# that originally invoked this script.
if [ "${BAZEL_REAL}" != "" ] && [ "${DISABLE_BAZEL_WRAPPER}" != "" ]
# DISABLE_BAZEL_WRAPPER can be set to eliminate the wrapper logic
if [ "${DISABLE_BAZEL_WRAPPER}" != "" ]
then
exec -a "$0" "${BAZEL_REAL}" "$@"
if [ "${BAZEL_REAL}" != "" ]
then
# use BAZEL_REAL as set by
# https://github.com/bazelbuild/bazel/blob/master/scripts/packages/bazel.sh
# that originally invoked this script (this is what happens when you
# run "bazel" in our workspace)
exec -a "$0" "${BAZEL_REAL}" "$@"
else
# if BAZEL_REAL is not set, just invoke the default system bazel
exec bazel "$@"
fi
fi
VERSION=1.0.0

@ -1243,6 +1243,11 @@ class Sanity(object):
if _is_use_docker_child():
environ['CLANG_FORMAT_SKIP_DOCKER'] = 'true'
environ['CLANG_TIDY_SKIP_DOCKER'] = 'true'
# sanity tests run tools/bazel wrapper concurrently
# and that can result in a download/run race in the wrapper.
# under docker we already have the right version of bazel
# so we can just disable the wrapper.
environ['DISABLE_BAZEL_WRAPPER'] = 'true'
return [
self.config.job_spec(cmd['script'].split(),
timeout_seconds=30 * 60,

Loading…
Cancel
Save