diff --git a/tests-fuzz/Cargo.toml b/tests-fuzz/Cargo.toml index 4f2f13b716df..b120ab4fd6fd 100644 --- a/tests-fuzz/Cargo.toml +++ b/tests-fuzz/Cargo.toml @@ -10,6 +10,10 @@ workspace = true [package.metadata] cargo-fuzz = true +[features] +default = [] +unstable = ["nix"] + [dependencies] arbitrary = { version = "1.3.0", features = ["derive"] } async-trait = { workspace = true } @@ -24,7 +28,7 @@ derive_builder = { workspace = true } dotenv = "0.15" lazy_static = { workspace = true } libfuzzer-sys = "0.4" -nix = { version = "0.28", features = ["process", "signal"] } +nix = { version = "0.28", features = ["process", "signal"], optional = true } partition = { workspace = true } rand = { workspace = true } rand_chacha = "0.3.1" @@ -80,3 +84,4 @@ path = "targets/unstable/fuzz_create_table_standalone.rs" test = false bench = false doc = false +required-features = ["unstable"] diff --git a/tests-fuzz/src/utils.rs b/tests-fuzz/src/utils.rs index 86ffb13c212e..ed837ed35c4d 100644 --- a/tests-fuzz/src/utils.rs +++ b/tests-fuzz/src/utils.rs @@ -14,6 +14,7 @@ pub mod config; pub mod health; +#[cfg(feature = "unstable")] pub mod process; use std::env; diff --git a/tests-fuzz/src/utils/health.rs b/tests-fuzz/src/utils/health.rs index e66da062712f..f4cbf2cb7710 100644 --- a/tests-fuzz/src/utils/health.rs +++ b/tests-fuzz/src/utils/health.rs @@ -15,7 +15,14 @@ use std::time::Duration; use crate::utils::info; -use crate::utils::process::HealthChecker; + +/// Check health of the processing. +#[async_trait::async_trait] +pub trait HealthChecker: Send + Sync { + async fn check(&self); + + fn wait_timeout(&self) -> Duration; +} /// Http health checker. pub struct HttpHealthChecker { diff --git a/tests-fuzz/src/utils/process.rs b/tests-fuzz/src/utils/process.rs index 7d3ce1968b1b..b3b03c042b2b 100644 --- a/tests-fuzz/src/utils/process.rs +++ b/tests-fuzz/src/utils/process.rs @@ -27,6 +27,7 @@ use tokio::fs::OpenOptions; use tokio::process::Child; use crate::error::{self, Result}; +use crate::utils::health::HealthChecker; pub type Pid = u32; @@ -142,14 +143,6 @@ impl ProcessManager { } } -/// Check health of the processing. -#[async_trait::async_trait] -pub trait HealthChecker: Send + Sync { - async fn check(&self); - - fn wait_timeout(&self) -> Duration; -} - #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum ProcessState { NotSpawn,