diff --git a/compiler/base/orchestrator/src/coordinator.rs b/compiler/base/orchestrator/src/coordinator.rs index 87a1363d9..d715edf73 100644 --- a/compiler/base/orchestrator/src/coordinator.rs +++ b/compiler/base/orchestrator/src/coordinator.rs @@ -2846,6 +2846,11 @@ mod tests { Ok(()) } + static TIMEOUT: Lazy = Lazy::new(|| { + let millis = env::var("TESTS_TIMEOUT_MS").ok().and_then(|v| v.parse().ok()).unwrap_or(5000); + Duration::from_millis(millis) + }); + trait TimeoutExt: Future + Sized { #[allow(clippy::type_complexity)] fn with_timeout( @@ -2854,7 +2859,7 @@ mod tests { tokio::time::Timeout, fn(Result) -> Self::Output, > { - tokio::time::timeout(Duration::from_millis(5000), self) + tokio::time::timeout(*TIMEOUT, self) .map(|v| v.expect("The operation timed out")) } }