[−][src]Macro tari_test_utils::async_assert_eventually
Periodically check if a value becomes the expected value within a maximum number of attempts.
The reason this has an 'async' in the name is because this doesn't use thread::sleep
, but
rather tokio::timer::delay(...). Therefore, needs to be in an async context using tokio threadpool.
let some_var = 123;
async_assert_eventually!(
some_var + 1,
expect = 124,
max_attempts = 10,
interval = Duration::from_millis(500)
);