From 59bf0f075faa40541e8953d81e681392009a732e Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Sat, 2 Nov 2024 19:51:06 +0400 Subject: [PATCH] streamer: put testing_utilities.rs behind dev-context-only-utils (#3442) * streamer: put testing_utilities.rs behind dev-context-only-utils * fix feature activation in tests --- Cargo.lock | 1 + core/Cargo.toml | 5 ++++- streamer/Cargo.toml | 6 +++++- streamer/src/nonblocking/mod.rs | 1 + tpu-client-next/Cargo.toml | 1 + 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3c7c3441eca7b4..d3b18093e7e78f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8381,6 +8381,7 @@ dependencies = [ "solana-metrics", "solana-perf", "solana-sdk", + "solana-streamer", "solana-transaction-metrics-tracker", "thiserror", "tokio", diff --git a/core/Cargo.toml b/core/Cargo.toml index 344d0360d7337c..310147fc001fe8 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -124,7 +124,10 @@ test-case = { workspace = true } sysctl = { workspace = true } [features] -dev-context-only-utils = ["solana-runtime/dev-context-only-utils"] +dev-context-only-utils = [ + "solana-runtime/dev-context-only-utils", + "solana-streamer/dev-context-only-utils", +] frozen-abi = [ "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", diff --git a/streamer/Cargo.toml b/streamer/Cargo.toml index da8b33d553fe58..f44e99771c0783 100644 --- a/streamer/Cargo.toml +++ b/streamer/Cargo.toml @@ -14,7 +14,7 @@ async-channel = { workspace = true } bytes = { workspace = true } crossbeam-channel = { workspace = true } dashmap = { workspace = true } -futures = { workspace = true } +futures = { workspace = true } futures-util = { workspace = true } governor = { workspace = true } histogram = { workspace = true } @@ -44,6 +44,10 @@ x509-parser = { workspace = true } [dev-dependencies] assert_matches = { workspace = true } solana-logger = { workspace = true } +solana-streamer = { path = ".", features = ["dev-context-only-utils"] } + +[features] +dev-context-only-utils = [] [lib] crate-type = ["lib"] diff --git a/streamer/src/nonblocking/mod.rs b/streamer/src/nonblocking/mod.rs index 61bd021ae0651e..38e9b9e3315499 100644 --- a/streamer/src/nonblocking/mod.rs +++ b/streamer/src/nonblocking/mod.rs @@ -3,4 +3,5 @@ pub mod quic; pub mod recvmmsg; pub mod sendmmsg; mod stream_throttle; +#[cfg(feature = "dev-context-only-utils")] pub mod testing_utilities; diff --git a/tpu-client-next/Cargo.toml b/tpu-client-next/Cargo.toml index 13ceb0e584a10f..88739eb79f6a04 100644 --- a/tpu-client-next/Cargo.toml +++ b/tpu-client-next/Cargo.toml @@ -29,6 +29,7 @@ tokio-util = { workspace = true } crossbeam-channel = { workspace = true } futures = { workspace = true } solana-cli-config = { workspace = true } +solana-streamer = { workspace = true, features = ["dev-context-only-utils"] } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"]