Skip to content

Commit

Permalink
Add timeout for waiting for reshare protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ameba23 committed Nov 28, 2024
1 parent 2e720b9 commit b7874c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/threshold-signature-server/src/validator/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ async fn test_reshare() {

// Now wait until signers have changed
let old_signer_ids = HashSet::from_iter(signer_stash_accounts.into_iter().map(|id| id.0));
let mut i = 0;
loop {
let new_signer_ids: HashSet<[u8; 32]> = {
let signer_query = entropy::storage().staking_extension().signers();
Expand All @@ -148,6 +149,10 @@ async fn test_reshare() {
if new_signer_ids != old_signer_ids {
break;
}
if i > 100 {
panic!("Timed out waiting for reshare protocol to finish successfully");
}
i += 1;
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
}

Expand Down

0 comments on commit b7874c9

Please sign in to comment.