Function holochain::test_utils::wait_for_integration
source · pub async fn wait_for_integration<Db: ReadAccess<DbKindDht>>(
db: &Db,
expected_count: usize,
num_attempts: usize,
delay: Duration
)
Expand description
Exit early if the expected number of ops have been integrated or wait for num_attempts * delay
Examples found in repository?
src/test_utils.rs (line 574)
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576
pub async fn consistency_dbs<AuthorDb, DhtDb>(
all_cell_dbs: &[(&AgentPubKey, &AuthorDb, Option<&DhtDb>)],
num_attempts: usize,
delay: Duration,
) where
AuthorDb: ReadAccess<DbKindAuthored>,
DhtDb: ReadAccess<DbKindDht>,
{
let mut expected_count = 0;
for (author, db) in all_cell_dbs.iter().map(|(author, a, _)| (author, a)) {
let count = get_published_ops(*db, *author).len();
expected_count += count;
}
for &db in all_cell_dbs.iter().flat_map(|(_, _, d)| d) {
wait_for_integration(db, expected_count, num_attempts, delay).await
}
}