Compile valgrind tests with Bazel (#4144)

This commit is contained in:
Philipp Moritz
2019-02-24 00:00:49 -08:00
committed by Robert Nishihara
parent 05d96ce81b
commit 615d5516d1
4 changed files with 27 additions and 62 deletions
+6 -15
View File
@@ -39,7 +39,7 @@ matrix:
- os: linux
dist: trusty
env: LINT=1 PYTHONWARNINGS=ignore RAY_USE_CMAKE=1
env: LINT=1 PYTHONWARNINGS=ignore
before_install:
# In case we ever want to use a different version of clang-format:
#- wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
@@ -77,20 +77,18 @@ matrix:
- os: linux
dist: trusty
env: VALGRIND=1 PYTHON=2.7 PYTHONWARNINGS=ignore RAY_USE_CMAKE=1
env: VALGRIND=1 PYTHON=2.7 PYTHONWARNINGS=ignore
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq valgrind
install:
- ./ci/travis/install-bazel.sh
- ./ci/travis/install-dependencies.sh
- export PATH="$HOME/miniconda/bin:$PATH"
- ./ci/travis/install-ray.sh
- ./ci/travis/install-with-cache-libs.sh
script:
- cd build
- bash ../src/ray/test/run_object_manager_valgrind.sh
- cd ..
- bash src/ray/test/run_object_manager_valgrind.sh
- export RAY_PLASMA_STORE_VALGRIND=1
# - export RAY_RAYLET_VALGRIND=1
@@ -147,15 +145,8 @@ install:
- bash src/ray/test/run_gcs_tests.sh
# Raylet tests.
- bash src/ray/test/run_object_manager_tests.sh
- bazel build "//:task_test" "//:worker_pool_test" "//:lineage_cache_test" "//:task_dependency_manager_test" "//:reconstruction_policy_test" "//:client_connection_test" "//:logging_test" "//:signal_test" -c opt
- ./bazel-bin/task_test
- ./bazel-bin/worker_pool_test
- ./bazel-bin/lineage_cache_test
- ./bazel-bin/task_dependency_manager_test
- ./bazel-bin/reconstruction_policy_test
- ./bazel-bin/client_connection_test
- ./bazel-bin/logging_test --gtest_filter=PrintLogTest*
- ./bazel-bin/signal_test
- bazel test --build_tests_only --test_lang_filters=cc ... -c opt
script:
- export PATH="$HOME/miniconda/bin:$PATH"
+1
View File
@@ -96,6 +96,7 @@ cc_test(
cc_test(
name = "logging_test",
srcs = ["src/ray/util/logging_test.cc"],
args = ["--gtest_filter=PrintLogTest*"],
copts = COPTS,
deps = [
":ray_util",
+7 -21
View File
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
# This needs to be run in the build tree, which is normally ray/build
# This needs to be run in the root directory.
# Cause the script to exit if a single command fails.
set -e
set -x
bazel build "//:object_manager_stress_test" "//:object_manager_test" "@plasma//:plasma_store_server" -c opt
bazel build -c opt "//:object_manager_stress_test" "//:object_manager_test" "@plasma//:plasma_store_server"
# Get the directory in which this script is executing.
SCRIPT_DIR="`dirname \"$0\"`"
@@ -22,36 +22,22 @@ if [ ! -d "$RAY_ROOT/python" ]; then
exit 1
fi
CORE_DIR="$RAY_ROOT/build"
PYTHON_CORE_DIR="$RAY_ROOT/python/ray/core"
REDIS_MODULE="./bazel-genfiles/ray_pkg/ray/core/src/ray/gcs/redis_module/libray_redis_module.so"
if [[ "${RAY_USE_NEW_GCS}" = "on" ]]; then
REDIS_SERVER="$CORE_DIR/src/credis/redis/src/redis-server"
CREDIS_MODULE="$CORE_DIR/src/credis/build/src/libmember.so"
LOAD_MODULE_ARGS="--loadmodule ${CREDIS_MODULE} --loadmodule ${REDIS_MODULE}"
else
REDIS_SERVER="./bazel-genfiles/ray_pkg/ray/core/src/ray/thirdparty/redis/src/redis-server"
LOAD_MODULE_ARGS="--loadmodule ${REDIS_MODULE}"
fi
LOAD_MODULE_ARGS="--loadmodule ${REDIS_MODULE}"
STORE_EXEC="./bazel-bin/external/plasma/plasma_store_server"
# Allow cleanup commands to fail.
./bazel-genfiles/ray_pkg/ray/core/src/ray/thirdparty/redis/src/redis-cli -p 6379 shutdown || true
bazel run -c opt //:redis-cli -- -p 6379 shutdown || true
sleep 1s
${REDIS_SERVER} --loglevel warning ${LOAD_MODULE_ARGS} --port 6379 &
bazel run -c opt //:redis-server -- --loglevel warning ${LOAD_MODULE_ARGS} --port 6379 &
sleep 1s
# Run tests.
./bazel-bin/object_manager_stress_test $STORE_EXEC
sleep 1s
# Use timeout=1000ms for the Wait tests.
./bazel-bin/object_manager_test $STORE_EXEC 1000
# Run tests again with inlined objects.
./bazel-bin/object_manager_test $STORE_EXEC 1000 true
./bazel-genfiles/ray_pkg/ray/core/src/ray/thirdparty/redis/src/redis-cli -p 6379 shutdown
bazel run -c opt //:redis-cli -- -p 6379 shutdown
sleep 1s
# Include raylet integration test once it's ready.
# $CORE_DIR/src/ray/raylet/object_manager_integration_test $STORE_EXEC
# ./bazel-bin/object_manager_integration_test $STORE_EXEC
+13 -26
View File
@@ -1,11 +1,13 @@
#!/usr/bin/env bash
# This needs to be run in the build tree, which is normally ray/build
# This needs to be run in the root directory.
# Cause the script to exit if a single command fails.
set -e
set -x
bazel build -c opt "//:object_manager_stress_test" "//:object_manager_test" "@plasma//:plasma_store_server"
# Get the directory in which this script is executing.
SCRIPT_DIR="`dirname \"$0\"`"
RAY_ROOT="$SCRIPT_DIR/../../.."
@@ -20,41 +22,26 @@ if [ ! -d "$RAY_ROOT/python" ]; then
exit 1
fi
CORE_DIR="$RAY_ROOT/build"
PYTHON_CORE_DIR="$RAY_ROOT/python/ray/core"
REDIS_DIR="$CORE_DIR/src/ray/thirdparty/redis/src"
REDIS_MODULE="$PYTHON_CORE_DIR/src/ray/gcs/redis_module/libray_redis_module.so"
STORE_EXEC="$PYTHON_CORE_DIR/src/plasma/plasma_store_server"
REDIS_MODULE="./bazel-genfiles/ray_pkg/ray/core/src/ray/gcs/redis_module/libray_redis_module.so"
LOAD_MODULE_ARGS="--loadmodule ${REDIS_MODULE}"
STORE_EXEC="./bazel-bin/external/plasma/plasma_store_server"
VALGRIND_CMD="valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all --leak-check-heuristics=stdstring --error-exitcode=1"
if [[ "${RAY_USE_NEW_GCS}" = "on" ]]; then
REDIS_SERVER="$CORE_DIR/src/credis/redis/src/redis-server"
CREDIS_MODULE="$CORE_DIR/src/credis/build/src/libmember.so"
LOAD_MODULE_ARGS="--loadmodule ${CREDIS_MODULE} --loadmodule ${REDIS_MODULE}"
else
REDIS_SERVER="${REDIS_DIR}/redis-server"
LOAD_MODULE_ARGS="--loadmodule ${REDIS_MODULE}"
fi
echo "$STORE_EXEC"
echo "${REDIS_SERVER} --loglevel warning ${LOAD_MODULE_ARGS} --port 6379"
echo "$REDIS_DIR/redis-cli -p 6379 shutdown"
# Allow cleanup commands to fail.
killall plasma_store || true
$REDIS_DIR/redis-cli -p 6379 shutdown || true
bazel run -c opt //:redis-cli -- -p 6379 shutdown || true
sleep 1s
${REDIS_SERVER} --loglevel warning ${LOAD_MODULE_ARGS} --port 6379 &
bazel run -c opt //:redis-server -- --loglevel warning ${LOAD_MODULE_ARGS} --port 6379 &
sleep 1s
# Run tests. Use timeout=10000ms for the Wait tests since tests run slower
# in valgrind.
$VALGRIND_CMD $CORE_DIR/src/ray/object_manager/object_manager_test $STORE_EXEC 10000
$VALGRIND_CMD ./bazel-bin/object_manager_test $STORE_EXEC 10000
sleep 1s
$VALGRIND_CMD $CORE_DIR/src/ray/object_manager/object_manager_stress_test $STORE_EXEC
$REDIS_DIR/redis-cli -p 6379 shutdown
$VALGRIND_CMD ./bazel-bin/object_manager_stress_test $STORE_EXEC
bazel run -c opt //:redis-cli -- -p 6379 shutdown
sleep 1s
# Include raylet integration test once it's ready.
# $CORE_DIR/src/ray/raylet/object_manager_integration_test $STORE_EXEC
# $VALGRIND_CMD ./bazel-bin/object_manager_integration_test $STORE_EXEC