Skip to content

Commit

Permalink
Merge pull request #5733 from stacks-network/test/flaky-global-accept…
Browse files Browse the repository at this point in the history
…ance-depends

Test flake: global_acceptance_depends_on_block_announcement
  • Loading branch information
kantai authored Jan 22, 2025
2 parents 9cacb22 + bbeb7d6 commit bc56d9e
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions testnet/stacks-node/src/tests/signer/v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9829,14 +9829,19 @@ fn global_acceptance_depends_on_block_announcement() {
.stacks_client
.get_peer_info()
.expect("Failed to get peer info");
Ok(info.stacks_tip_height > info_before.stacks_tip_height)
Ok(info.stacks_tip_height > info_before.stacks_tip_height
&& info_before.stacks_tip_consensus_hash != info.stacks_tip_consensus_hash)
},
)
.unwrap();
.expect("Stacks miner failed to produce new blocks during the newest burn block's tenure");
let info_after = signer_test
.stacks_client
.get_peer_info()
.expect("Failed to get peer info");
let info_after_stacks_block_id = StacksBlockId::new(
&info_after.stacks_tip_consensus_hash,
&info_after.stacks_tip,
);
let mut sister_block = None;
let start_time = Instant::now();
while sister_block.is_none() && start_time.elapsed() < Duration::from_secs(45) {
Expand All @@ -9846,17 +9851,14 @@ fn global_acceptance_depends_on_block_announcement() {
.find_map(|chunk| {
let message = SignerMessage::consensus_deserialize(&mut chunk.data.as_slice())
.expect("Failed to deserialize SignerMessage");
match message {
SignerMessage::BlockProposal(proposal) => {
if proposal.block.header.consensus_hash
== info_after.stacks_tip_consensus_hash
{
Some(proposal.block)
} else {
None
}
if let SignerMessage::BlockProposal(proposal) = message {
if proposal.block.block_id() == info_after_stacks_block_id {
Some(proposal.block)
} else {
None
}
_ => None,
} else {
None
}
});
}
Expand Down

0 comments on commit bc56d9e

Please sign in to comment.