diff --git a/bazel/README.md b/bazel/README.md index 227c87c9312a6..5817d9cd42555 100644 --- a/bazel/README.md +++ b/bazel/README.md @@ -100,6 +100,18 @@ bazel test //test/... --test_env=ENVOY_IP_TEST_VERSIONS=v4only bazel test //test/... --test_env=ENVOY_IP_TEST_VERSIONS=v6only ``` +By default, tests are run with the [gperftools](https://github.com/gperftools/gperftools) heap +checker enabled in "normal" mode to detect leaks. For other mode options, see the gperftools +heap checker [documentation](https://gperftools.github.io/gperftools/heap_checker.html). To +disable the heap checker or change the mode, set the HEAPCHECK environment variable: + +``` +# Disables the heap checker +bazel test //test/... --test_env=HEAPCHECK= +# Changes the heap checker to "minimal" mode +bazel test //test/... --test_env=HEAPCHECK=minimal +``` + Bazel will by default cache successful test results. To force it to rerun tests: ``` diff --git a/ci/build_setup.sh b/ci/build_setup.sh index ece8a76234503..ed30c98358a81 100755 --- a/ci/build_setup.sh +++ b/ci/build_setup.sh @@ -4,7 +4,6 @@ set -e -export HEAPCHECK=normal export PPROF_PATH=/thirdparty_build/bin/pprof NUM_CPUS=`grep -c ^processor /proc/cpuinfo` diff --git a/tools/bazel.rc b/tools/bazel.rc index c773e77960f16..c8ecbbeb5c546 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -38,3 +38,6 @@ build:clang-msan --copt -fsanitize=memory build:clang-msan --linkopt -fsanitize=memory build:clang-msan --define tcmalloc=disabled build:clang-msan --copt -fsanitize-memory-track-origins=2 + +# Test options +test --test_env=HEAPCHECK=normal --test_env=PPROF_PATH