From 031e57a973d5be159012a7af44d4b41f7abd61be Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 14 Sep 2022 16:10:52 +0300 Subject: [PATCH] Disable failpoints by default --- .github/workflows/build_and_test.yml | 6 ++++-- pageserver/Cargo.toml | 10 +++++----- test_runner/README.md | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d586741d68..7688f9c1bd 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -94,15 +94,17 @@ jobs: # CARGO_FEATURES is passed to "cargo metadata". It is separate from CARGO_FLAGS, # because "cargo metadata" doesn't accept --release or --debug options # + # We run tests with addtional features, that are turned off by default (e.g. in release builds), see + # corresponding Cargo.toml files for their descriptions. - name: Set env variables run: | if [[ $BUILD_TYPE == "debug" ]]; then cov_prefix="scripts/coverage --profraw-prefix=$GITHUB_JOB --dir=/tmp/coverage run" - CARGO_FEATURES="" + CARGO_FEATURES="--features failpoints" CARGO_FLAGS="--locked --timings" elif [[ $BUILD_TYPE == "release" ]]; then cov_prefix="" - CARGO_FEATURES="--features profiling" + CARGO_FEATURES="--features failpoints,profiling" CARGO_FLAGS="--locked --timings --release $CARGO_FEATURES" fi echo "cov_prefix=${cov_prefix}" >> $GITHUB_ENV diff --git a/pageserver/Cargo.toml b/pageserver/Cargo.toml index 11d2d94906..ce09e788bd 100644 --- a/pageserver/Cargo.toml +++ b/pageserver/Cargo.toml @@ -4,12 +4,12 @@ version = "0.1.0" edition = "2021" [features] -# It is simpler infra-wise to have failpoints enabled by default -# It shouldn't affect performance in any way because failpoints -# are not placed in hot code paths -default = ["failpoints"] -profiling = ["pprof"] +default = [] + +# Feature that enables a special API, fail_point! macro (adds some runtime cost) +# to run tests on outage conditions failpoints = ["fail/failpoints"] +profiling = ["pprof"] [dependencies] async-stream = "0.3" diff --git a/test_runner/README.md b/test_runner/README.md index 44751944b3..01fe4ff863 100644 --- a/test_runner/README.md +++ b/test_runner/README.md @@ -6,6 +6,7 @@ Prerequisites: - Correctly configured Python, see [`/docs/sourcetree.md`](/docs/sourcetree.md#using-python) - Neon and Postgres binaries - See the root [README.md](/README.md) for build directions + If you want to test tests with failpoints, you would need to add `--features failpoints` to Rust code build commands. - Tests can be run from the git tree; or see the environment variables below to run from other directories. - The neon git repo, including the postgres submodule