Skip to content

Commit e68a3bf

Browse files
committed
Make the test timeout configurable from an environment variable
These can be slower when running the amd64 Docker images on an arm64 host.
1 parent abe23c6 commit e68a3bf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/base/orchestrator/src/coordinator.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2846,6 +2846,11 @@ mod tests {
28462846
Ok(())
28472847
}
28482848

2849+
static TIMEOUT: Lazy<Duration> = Lazy::new(|| {
2850+
let millis = env::var("TESTS_TIMEOUT_MS").ok().and_then(|v| v.parse().ok()).unwrap_or(5000);
2851+
Duration::from_millis(millis)
2852+
});
2853+
28492854
trait TimeoutExt: Future + Sized {
28502855
#[allow(clippy::type_complexity)]
28512856
fn with_timeout(
@@ -2854,7 +2859,7 @@ mod tests {
28542859
tokio::time::Timeout<Self>,
28552860
fn(Result<Self::Output, tokio::time::error::Elapsed>) -> Self::Output,
28562861
> {
2857-
tokio::time::timeout(Duration::from_millis(5000), self)
2862+
tokio::time::timeout(*TIMEOUT, self)
28582863
.map(|v| v.expect("The operation timed out"))
28592864
}
28602865
}

0 commit comments

Comments
 (0)