From 8ba72ea886745f5c623b07c2c25714e0ca7a77a2 Mon Sep 17 00:00:00 2001
From: Peter Jankuliak
Date: Thu, 7 Sep 2023 15:20:26 +0200
Subject: [PATCH] Write all blocks in transfer_snapshot_between_two_replicas at
once
To make the test go faster. Especially now with throttling RootNode
updates the test was running with the speed of one block per throttle
period (1s), which caused the test to time out.
---
lib/src/network/tests.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/src/network/tests.rs b/lib/src/network/tests.rs
index 49f169e4c..05f4f51c4 100644
--- a/lib/src/network/tests.rs
+++ b/lib/src/network/tests.rs
@@ -109,7 +109,7 @@ async fn transfer_snapshot_between_two_replicas_case(
// TODO: Make it faster and increase the cases.
#[proptest(cases = 8)]
fn transfer_blocks_between_two_replicas(
- #[strategy(1usize..32)] block_count: usize,
+ #[strategy(1usize..62)] block_count: usize,
#[strategy(test_utils::rng_seed_strategy())] rng_seed: u64,
) {
test_utils::run(transfer_blocks_between_two_replicas_case(
@@ -145,8 +145,10 @@ async fn transfer_blocks_between_two_replicas_case(block_count: usize, rng_seed:
a_vault.receive_block(block, Some(promise)).await.unwrap();
tracing::info!(?id, "write block");
+ }
- // Then wait until replica B receives and writes it too.
+ // Then wait until replica B receives and writes it too.
+ for (id, _block) in snapshot.blocks() {
wait_until_block_exists(&b_vault, id).await;
}
};