Skip to main content

run_with_timeout

Function run_with_timeout 

Source
pub async fn run_with_timeout<F, T>(
    name: impl Into<String>,
    timeout: Duration,
    fut: F,
) -> CheckResult
where F: Future<Output = T>,
Expand description

Run a future with a hard timeout. Produces a CheckResult.

If the future completes before the timeout, the verdict is Pass and the duration is recorded.

If the future does not complete in time, the verdict is Fail with severity Error. The future itself is dropped (cancelled) when the timeout expires.