diff --git a/polars/Makefile b/polars/Makefile index 72b7ccf07353..b361135c06a1 100644 --- a/polars/Makefile +++ b/polars/Makefile @@ -34,7 +34,7 @@ miri: # not tested on all features because miri does not support SIMD # some tests are also filtered, because miri cannot deal with the rayon threadpool # Miri also reports UB in prettytable.rs, so we must toggle that feature off. - MIRIFLAGS="-Zmiri-disable-isolation" \ + MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" \ POLARS_ALLOW_EXTENSION=1 \ cargo miri test \ --no-default-features \ diff --git a/polars/polars-core/src/testing.rs b/polars/polars-core/src/testing.rs index ffb1df5f55a2..ca19ed5e0a75 100644 --- a/polars/polars-core/src/testing.rs +++ b/polars/polars-core/src/testing.rs @@ -199,4 +199,18 @@ mod test { assert_eq!(df3, df3); assert_ne!(df4, df4); } + + //-----RAYON LEAK PROOF----- + #[test] + fn test_miri_rayonthread_leak1() { + crate::POOL.install(|| ()); + } + + #[test] + fn test_miri_rayonthread_leak2() { + use rayon::prelude::*; + let tmp: Vec = [1, 2].par_iter().map(|x| x * x).collect(); + assert_eq!(tmp, &[1, 4]); + } + //-------------- }