Skip to content

Commit

Permalink
test(node): increase reverification delay
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Nov 29, 2023
1 parent d03478b commit 9089324
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions sn_node/tests/verify_data_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ const CHUNK_SIZE: usize = 1024;
// for the old peer to be removed from the routing table.
// Replication is then kicked off to distribute the data to the new closest
// nodes, hence verification has to be performed after this.
const VERIFICATION_DELAY: Duration = Duration::from_secs(200);
const VERIFICATION_DELAY: Duration = Duration::from_secs(120);

// Number of times to retry verification if it fails
/// Number of times to retry verification if it fails
const VERIFICATION_ATTEMPTS: usize = 5;

/// Length of time to wait before re-verifying the data location
const REVERIFICATION_DELAY: Duration = Duration::from_secs(30);

// Default number of churns that should be performed. After each churn, we
// wait for VERIFICATION_DELAY time before verifying the data location.
// It can be overridden by setting the 'CHURN_COUNT' env var.
Expand Down Expand Up @@ -253,7 +256,7 @@ async fn verify_location(all_peers: &[PeerId], node_rpc_addresses: &[SocketAddr]
.for_each(|(idx, peer)| println!("{idx} : {peer:?}"));
verification_attempts += 1;
println!("Sleeping before retrying verification");
tokio::time::sleep(Duration::from_secs(20)).await;
tokio::time::sleep(REVERIFICATION_DELAY).await;
} else {
// if successful, break out of the loop
break;
Expand Down

0 comments on commit 9089324

Please sign in to comment.