From b7874c95d1b9fcd48f3875d879dcbdeaea481b4e Mon Sep 17 00:00:00 2001 From: peg Date: Thu, 28 Nov 2024 08:19:32 +0100 Subject: [PATCH] Add timeout for waiting for reshare protocol --- crates/threshold-signature-server/src/validator/tests.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/threshold-signature-server/src/validator/tests.rs b/crates/threshold-signature-server/src/validator/tests.rs index c601ea449..02769ced8 100644 --- a/crates/threshold-signature-server/src/validator/tests.rs +++ b/crates/threshold-signature-server/src/validator/tests.rs @@ -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(); @@ -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; }