Skip to main content

wait_until

Function wait_until 

Source
pub async fn wait_until<F, Fut>(timeout: Duration, condition: F) -> bool
where F: FnMut() -> Fut, Fut: Future<Output = bool>,
Expand description

Polls condition until it holds, or gives up after timeout of real time.

The probe-timer tests drive a simulated clock but still have to let a spawned listener run; waiting on an observable counter rather than a fixed sleep keeps them from failing as “never repaired” on a loaded runner, where the real work is a subscribe plus a full sync against the storage backend under test.