From 37035f1868fabe7d17623665485c1a9d77361dba Mon Sep 17 00:00:00 2001 From: Benjamin Naecker Date: Mon, 6 Nov 2023 23:17:20 +0000 Subject: [PATCH] Use nextest test-groups to serialize replicated cluster tests in oximeter-db --- .config/nextest.toml | 12 ++++++++++++ Cargo.lock | 1 - oximeter/db/Cargo.toml | 1 - oximeter/db/src/client.rs | 3 --- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.config/nextest.toml b/.config/nextest.toml index ba07186c8a7..79774e3658e 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -18,3 +18,15 @@ fail-fast = false [script.crdb-seed] command = 'cargo run -p crdb-seed' + +# The ClickHouse cluster tests currently rely on a hard-coded set of ports for +# the nodes in the cluster. We would like to relax this in the future, at which +# point this test-group configuration can be removed or at least loosened to +# support testing in parallel. For now, enforce strict serialization for all +# tests with `replicated` in the name. +[test-groups] +clickhouse-cluster = { max-threads = 1 } + +[[profile.default.overrides]] +filter = 'package(oximeter-db) and test(replicated)' +test-group = 'clickhouse-cluster' diff --git a/Cargo.lock b/Cargo.lock index 33434a893e9..131e60ea5e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5815,7 +5815,6 @@ dependencies = [ "schemars", "serde", "serde_json", - "serial_test", "slog", "slog-async", "slog-dtrace", diff --git a/oximeter/db/Cargo.toml b/oximeter/db/Cargo.toml index b2a90be7138..4d53869d0dc 100644 --- a/oximeter/db/Cargo.toml +++ b/oximeter/db/Cargo.toml @@ -35,7 +35,6 @@ omicron-workspace-hack.workspace = true expectorate.workspace = true itertools.workspace = true omicron-test-utils.workspace = true -serial_test.workspace = true slog-dtrace.workspace = true strum.workspace = true tempfile.workspace = true diff --git a/oximeter/db/src/client.rs b/oximeter/db/src/client.rs index b2b994ae623..6864ca194e5 100644 --- a/oximeter/db/src/client.rs +++ b/oximeter/db/src/client.rs @@ -1407,7 +1407,6 @@ mod tests { } #[tokio::test] - #[serial_test::serial] async fn test_replicated() { let mut cluster = ClickHouseCluster::new() .await @@ -3821,7 +3820,6 @@ mod tests { } #[tokio::test] - #[serial_test::serial] async fn test_apply_one_schema_upgrade_replicated() { const TEST_NAME: &str = "test_apply_one_schema_upgrade_replicated"; let logctx = test_setup_log(TEST_NAME); @@ -4068,7 +4066,6 @@ mod tests { } #[tokio::test] - #[serial_test::serial] async fn test_ensure_schema_walks_through_multiple_steps_replicated() { const TEST_NAME: &str = "test_ensure_schema_walks_through_multiple_steps_replicated";