Function fixture::utils::run_with_timeout
source · pub fn run_with_timeout<F, U>(closure: F, timeout: Duration) -> Result<U>
Expand description
Run the provided closure in a separate thread and return it’s result. If the closure does not finish before the timeout is reached, an Error is returned instead.
WARNING: It is not possible to kill the closure if a timeout occurs. It is advised to panic when an error is returned.