Function holochain::test_utils::consistency_advanced
source · pub async fn consistency_advanced<'a, I: IntoIterator<Item = (&'a SweetCell, bool)>>(
all_cells: I,
num_attempts: usize,
delay: Duration
)
Expand description
Wait for all cells to reach consistency, with the option to specify that some cells are offline.
Cells paired with a false
value will have their authored ops counted towards the total,
but not their integrated ops (since they are not online to integrate things).
This is useful for tests where nodes go offline.
Examples found in repository?
src/test_utils.rs (line 491)
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509
pub async fn consistency_10s_advanced<'a, I: IntoIterator<Item = (&'a SweetCell, bool)>>(
all_cells: I,
) {
const NUM_ATTEMPTS: usize = 100;
const DELAY_PER_ATTEMPT: std::time::Duration = std::time::Duration::from_millis(100);
consistency_advanced(all_cells, NUM_ATTEMPTS, DELAY_PER_ATTEMPT).await
}
/// Wait for all cells to reach consistency for 60 seconds
pub async fn consistency_60s<'a, I: IntoIterator<Item = &'a SweetCell>>(all_cells: I) {
const NUM_ATTEMPTS: usize = 60;
const DELAY_PER_ATTEMPT: std::time::Duration = std::time::Duration::from_secs(1);
consistency(all_cells, NUM_ATTEMPTS, DELAY_PER_ATTEMPT).await
}
/// Wait for all cells to reach consistency for 60 seconds,
/// with the option to specify that some cells are offline.
pub async fn consistency_60s_advanced<'a, I: IntoIterator<Item = (&'a SweetCell, bool)>>(
all_cells: I,
) {
const NUM_ATTEMPTS: usize = 60;
const DELAY_PER_ATTEMPT: std::time::Duration = std::time::Duration::from_secs(1);
consistency_advanced(all_cells, NUM_ATTEMPTS, DELAY_PER_ATTEMPT).await
}