Skip to content

Commit b543726

Browse files
committed
test: resolve flakiness in global_acceptance_depends_on_block_announcement
1 parent 0799e26 commit b543726

File tree

1 file changed

+13
-19
lines changed
  • testnet/stacks-node/src/tests/signer

1 file changed

+13
-19
lines changed

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

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8421,28 +8421,22 @@ fn global_acceptance_depends_on_block_announcement() {
84218421
);
84228422

84238423
TEST_REJECT_ALL_BLOCK_PROPOSAL.set(Vec::new());
8424-
TEST_SKIP_BLOCK_ANNOUNCEMENT.set(false);
84258424
TEST_IGNORE_SIGNERS.set(false);
8426-
TEST_SKIP_BLOCK_BROADCAST.set(false);
84278425
test_observer::clear();
8428-
let info_before = signer_test.get_peer_info();
8429-
next_block_and(
8430-
&mut signer_test.running_nodes.btc_regtest_controller,
8431-
60,
8432-
|| {
8433-
let info = signer_test
8434-
.stacks_client
8435-
.get_peer_info()
8436-
.expect("Failed to get peer info");
8437-
Ok(info.stacks_tip_height > info_before.stacks_tip_height
8438-
&& info_before.stacks_tip_consensus_hash != info.stacks_tip_consensus_hash)
8439-
},
8440-
)
8441-
.expect("Stacks miner failed to produce new blocks during the newest burn block's tenure");
84428426

8443-
let sister_block =
8444-
wait_for_block_pushed_by_miner_key(30, info_before.stacks_tip_height + 1, &miner_pk)
8445-
.expect("Timed out waiting for block N+1' to be mined");
8427+
signer_test
8428+
.running_nodes
8429+
.btc_regtest_controller
8430+
.build_next_block(1);
8431+
8432+
let sister_block = wait_for_block_proposal(30, info_before.stacks_tip_height + 1, &miner_pk)
8433+
.expect("Timed out waiting for block N+1' to be proposed");
8434+
8435+
TEST_SKIP_BLOCK_ANNOUNCEMENT.set(false);
8436+
TEST_SKIP_BLOCK_BROADCAST.set(false);
8437+
8438+
wait_for_block_pushed(30, sister_block.header.signer_signature_hash())
8439+
.expect("Timed out waiting for block N+1' to be mined");
84468440
assert_ne!(
84478441
sister_block.header.signer_signature_hash(),
84488442
block_n_1.header.signer_signature_hash()

0 commit comments

Comments
 (0)