From 5f570790416baf1dd22e1b17fdf5d62608f7a1ec Mon Sep 17 00:00:00 2001 From: Chen Shen Date: Thu, 9 Sep 2021 15:48:36 -0700 Subject: [PATCH] use clang for C++ debug testing (#18343) --- .bazelrc | 3 +++ .buildkite/Dockerfile | 1 + .buildkite/pipeline.yml | 7 +++---- src/ray/object_manager/plasma/test/stats_collector_test.cc | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.bazelrc b/.bazelrc index b998d2861..fad6c0ba0 100644 --- a/.bazelrc +++ b/.bazelrc @@ -94,6 +94,9 @@ build:asan --copt -fno-omit-frame-pointer build:asan --linkopt -fsanitize=address test:asan --jobs=1 test:asan --test_env=ASAN_OPTIONS="detect_leaks=0" +# https://github.com/google/sanitizers/issues/1017 +build:asan-clang --copt -mllvm +build:asan-clang --copt -asan-use-private-alias=1 build:asan-build --strip=never build:asan-build -c dbg diff --git a/.buildkite/Dockerfile b/.buildkite/Dockerfile index 4d2367406..f214d11bb 100644 --- a/.buildkite/Dockerfile +++ b/.buildkite/Dockerfile @@ -37,6 +37,7 @@ RUN apt-get install -y -qq \ RUN ln -s /usr/bin/clang-format-7 /usr/bin/clang-format && \ ln -s /usr/bin/clang-tidy-12 /usr/bin/clang-tidy && \ ln -s /usr/bin/clang-12 /usr/bin/clang + RUN curl -o- https://get.docker.com | sh # System conf for tests diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 86b7310d6..d94f8338b 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -135,7 +135,7 @@ - label: ":cpp: Tests" commands: - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/travis/upload_build_info.sh; fi }; trap cleanup EXIT - - bazel test --config=ci $(./scripts/bazel_export_options) + - CC=clang bazel test --config=ci $(./scripts/bazel_export_options) --build_tests_only --test_tag_filters=-flaky -- //:all -rllib/... -core_worker_test @@ -143,9 +143,8 @@ - label: ":cpp: Tests (ASAN)" commands: - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/travis/upload_build_info.sh; fi }; trap cleanup EXIT - - bazel test --config=ci --config=asan $(./scripts/bazel_export_options) + - CC=clang bazel test --config=ci --config=asan --config=asan-clang $(./scripts/bazel_export_options) --build_tests_only - --config=asan-buildkite --jobs=2 --test_tag_filters=-flaky -- //:all -//:core_worker_test @@ -162,7 +161,7 @@ - label: ":cpp: Tests (TSAN)" commands: - cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/travis/upload_build_info.sh; fi }; trap cleanup EXIT - - bazel test --config=ci --config=tsan $(./scripts/bazel_export_options) + - CC=clang bazel test --config=ci --config=tsan $(./scripts/bazel_export_options) --build_tests_only --jobs=2 --test_tag_filters=-flaky diff --git a/src/ray/object_manager/plasma/test/stats_collector_test.cc b/src/ray/object_manager/plasma/test/stats_collector_test.cc index f1f656db5..b8570f0c8 100644 --- a/src/ray/object_manager/plasma/test/stats_collector_test.cc +++ b/src/ray/object_manager/plasma/test/stats_collector_test.cc @@ -159,6 +159,7 @@ struct ObjectStatsCollectorTest : public Test { ray::ObjectInfo info; info.object_id = id; info.data_size = data_size; + info.metadata_size = 0; return info; }