diff --git a/nautilus_core/persistence/Cargo.toml b/nautilus_core/persistence/Cargo.toml index 99495986a93c..05553d215073 100644 --- a/nautilus_core/persistence/Cargo.toml +++ b/nautilus_core/persistence/Cargo.toml @@ -47,6 +47,7 @@ criterion = { workspace = true } rstest = { workspace = true } quickcheck = "1" quickcheck_macros = "1" +[target.'cfg(target_os = "linux")'.dependencies] procfs = "0.16.0" [[bench]] diff --git a/nautilus_core/persistence/tests/test_catalog.rs b/nautilus_core/persistence/tests/test_catalog.rs index b2cbe3454316..7965e5d8eb68 100644 --- a/nautilus_core/persistence/tests/test_catalog.rs +++ b/nautilus_core/persistence/tests/test_catalog.rs @@ -22,6 +22,7 @@ use nautilus_persistence::{ backend::session::{DataBackendSession, DataQueryResult, QueryResult}, python::backend::session::NautilusDataType, }; +#[cfg(target_os = "linux")] use procfs::{self, process::Process}; use pyo3::{types::PyCapsule, IntoPy, Py, PyAny, Python}; use rstest::rstest; @@ -31,6 +32,7 @@ use rstest::rstest; /// Uses arguments from setup to run function for given number of iterations. /// Checks that the difference between memory after 1 and iter + 1 runs is /// less than threshold. +#[cfg(target_os = "linux")] fn mem_leak_test(setup: impl FnOnce() -> T, run: impl Fn(&T), threshold: f64, iter: usize) { let args = setup(); // measure mem after setup @@ -58,6 +60,7 @@ fn mem_leak_test(setup: impl FnOnce() -> T, run: impl Fn(&T), threshold: f64, } } +#[cfg(target_os = "linux")] #[rstest] fn catalog_query_mem_leak_test() { mem_leak_test(