diff --git a/polkadot/Cargo.lock b/polkadot/Cargo.lock index 908ba17c3d0aff0b165f753ba839b5e958ba1be2..e1f80c6aafd7033a6ce323d49dc0ee5ef3e01918 100644 --- a/polkadot/Cargo.lock +++ b/polkadot/Cargo.lock @@ -6824,6 +6824,7 @@ dependencies = [ "nix 0.26.2", "polkadot-cli", "polkadot-core-primitives", + "polkadot-node-core-pvf", "polkadot-node-core-pvf-prepare-worker", "polkadot-overseer", "substrate-rpc-client", diff --git a/polkadot/Cargo.toml b/polkadot/Cargo.toml index 74f2b95705174abd1d40a6c479366c31c72d345e..c23837b9c5ed02a48967b8cc1f49eefdc9ad7b1e 100644 --- a/polkadot/Cargo.toml +++ b/polkadot/Cargo.toml @@ -24,6 +24,7 @@ tikv-jemallocator = "0.5.0" # Crates in our workspace, defined as dependencies so we can pass them feature flags. polkadot-cli = { path = "cli", features = [ "polkadot-native", "kusama-native", "westend-native", "rococo-native" ] } +polkadot-node-core-pvf = { path = "node/core/pvf" } polkadot-node-core-pvf-prepare-worker = { path = "node/core/pvf/prepare-worker" } polkadot-overseer = { path = "node/overseer" } @@ -210,6 +211,10 @@ runtime-metrics = [ "polkadot-cli/runtime-metrics" ] pyroscope = ["polkadot-cli/pyroscope"] jemalloc-allocator = ["polkadot-node-core-pvf-prepare-worker/jemalloc-allocator", "polkadot-overseer/jemalloc-allocator"] +# Enables timeout-based tests supposed to be run only in CI environment as they may be flaky +# when run locally depending on system load +ci-only-tests = ["polkadot-node-core-pvf/ci-only-tests"] + # Configuration for building a .deb package - for use with `cargo-deb` [package.metadata.deb] name = "polkadot" diff --git a/polkadot/node/core/pvf/Cargo.toml b/polkadot/node/core/pvf/Cargo.toml index 396f8b7ce05b498e415fd3d7a4ef48b331ca94f9..658a26cff09d22c1509f2f32f2191a10b7a1973e 100644 --- a/polkadot/node/core/pvf/Cargo.toml +++ b/polkadot/node/core/pvf/Cargo.toml @@ -45,3 +45,6 @@ hex-literal = "0.3.4" adder = { package = "test-parachain-adder", path = "../../../parachain/test-parachains/adder" } halt = { package = "test-parachain-halt", path = "../../../parachain/test-parachains/halt" } + +[features] +ci-only-tests = [] diff --git a/polkadot/node/core/pvf/tests/it/main.rs b/polkadot/node/core/pvf/tests/it/main.rs index ef461a3531b5e17884adbf31a5fc7353b541a96c..e2877346f09d91b435535fdaf248d2d702845e61 100644 --- a/polkadot/node/core/pvf/tests/it/main.rs +++ b/polkadot/node/core/pvf/tests/it/main.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see <http://www.gnu.org/licenses/>. +#[cfg(feature = "ci-only-tests")] use assert_matches::assert_matches; use parity_scale_codec::Encode as _; use polkadot_node_core_pvf::{ @@ -21,7 +22,11 @@ use polkadot_node_core_pvf::{ ValidationHost, JOB_TIMEOUT_WALL_CLOCK_FACTOR, }; use polkadot_parachain::primitives::{BlockData, ValidationParams, ValidationResult}; -use polkadot_primitives::{ExecutorParam, ExecutorParams}; +use polkadot_primitives::ExecutorParams; + +#[cfg(feature = "ci-only-tests")] +use polkadot_primitives::ExecutorParam; + use std::time::Duration; use tokio::sync::Mutex; @@ -115,6 +120,7 @@ async fn terminates_on_timeout() { assert!(duration < TEST_EXECUTION_TIMEOUT * JOB_TIMEOUT_WALL_CLOCK_FACTOR); } +#[cfg(feature = "ci-only-tests")] #[tokio::test] async fn ensure_parallel_execution() { // Run some jobs that do not complete, thus timing out. @@ -197,6 +203,7 @@ async fn execute_queue_doesnt_stall_if_workers_died() { ); } +#[cfg(feature = "ci-only-tests")] #[tokio::test] async fn execute_queue_doesnt_stall_with_varying_executor_params() { let host = TestHost::new_with_config(|cfg| { diff --git a/polkadot/scripts/ci/gitlab/pipeline/test.yml b/polkadot/scripts/ci/gitlab/pipeline/test.yml index df3a8c24d047cbdcf02c801f2d12905c4e9d4fd6..222a6d0017117afd6df7b6558a48a149a5e8764c 100644 --- a/polkadot/scripts/ci/gitlab/pipeline/test.yml +++ b/polkadot/scripts/ci/gitlab/pipeline/test.yml @@ -41,7 +41,7 @@ test-linux-stable: # but still want to have debug assertions. RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings" script: - - time cargo test --workspace --profile testnet --verbose --locked --features=runtime-benchmarks,runtime-metrics,try-runtime + - time cargo test --workspace --profile testnet --verbose --locked --features=runtime-benchmarks,runtime-metrics,try-runtime,ci-only-tests test-linux-oldkernel-stable: extends: test-linux-stable