1use once_cell::sync::Lazy;
5use tracing::warn;
6
7pub mod backoff;
8pub mod decay_moving_average;
9pub mod logging;
10pub mod moving_window;
11pub mod random;
12pub mod random_util;
13pub mod sync;
14
15pub use random_util::tempdir;
16
17#[inline(always)]
18pub fn in_antithesis() -> bool {
19 static IN_ANTITHESIS: Lazy<bool> = Lazy::new(|| {
20 let in_antithesis = std::env::var("ANTITHESIS_OUTPUT_DIR").is_ok();
21 if in_antithesis {
22 warn!("Detected that we are running in antithesis");
23 }
24 in_antithesis
25 });
26 *IN_ANTITHESIS
27}
28
29#[inline(always)]
30pub fn in_test_configuration() -> bool {
31 in_antithesis() || cfg!(msim) || cfg!(debug_assertions)
32}