Skip to content

Commit 35f866b

Browse files
committed
Do not have an infinite loop inside mine_and_verify_confirmed_naka_block
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent b09ffc6 commit 35f866b

File tree

1 file changed

+10
-0
lines changed
  • testnet/stacks-node/src/tests/signer

1 file changed

+10
-0
lines changed

testnet/stacks-node/src/tests/signer/v0.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@ impl SignerTest<SpawnedSigner> {
311311
let mut signer_index = 0;
312312
let mut signature_index = 0;
313313
let mut signing_keys = HashSet::new();
314+
let start = Instant::now();
315+
debug!(
316+
"Validating {} signatures against {num_signers} signers",
317+
signature.len()
318+
);
314319
let validated = loop {
315320
// Since we've already checked `signature.len()`, this means we've
316321
// validated all the signatures in this loop
@@ -341,6 +346,11 @@ impl SignerTest<SpawnedSigner> {
341346
signer_index += 1;
342347
signature_index += 1;
343348
}
349+
// Shouldn't really ever timeout, but do this in case there is some sort of overflow/underflow happening.
350+
assert!(
351+
start.elapsed() < timeout,
352+
"Timed out waiting to confirm block signatures"
353+
);
344354
};
345355

346356
assert!(validated);

0 commit comments

Comments
 (0)