Skip to content

Commit 693b5da

Browse files
committed
test: improvements to empty sortition tests
1 parent eae2ce2 commit 693b5da

File tree

1 file changed

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

1 file changed

+13
-13
lines changed

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,13 +2728,9 @@ fn empty_sortition_before_approval() {
27282728
info!("Found tenure extend block");
27292729
return Ok(true);
27302730
}
2731-
TenureChangeCause::BlockFound => {
2732-
info!("Found block with tenure change");
2733-
}
2731+
TenureChangeCause::BlockFound => {}
27342732
},
2735-
payload => {
2736-
info!("Found tx with payload: {:?}", payload);
2737-
}
2733+
_ => {}
27382734
};
27392735
}
27402736
Ok(false)
@@ -2834,13 +2830,21 @@ fn empty_sortition_before_proposal() {
28342830
info!("Pause miner so it doesn't propose a block before the next tenure arrives");
28352831
TEST_MINE_STALL.lock().unwrap().replace(true);
28362832

2833+
let burn_height_before = get_chain_info(&signer_test.running_nodes.conf).burn_block_height;
2834+
28372835
info!("------------------------- Test Mine Tenure A and B -------------------------");
28382836
signer_test
28392837
.running_nodes
28402838
.btc_regtest_controller
28412839
.build_next_block(2);
28422840

2843-
// Sleep to ensure the signers see both burn blocks
2841+
wait_for(60, || {
2842+
let info = get_chain_info(&signer_test.running_nodes.conf);
2843+
Ok(info.burn_block_height == burn_height_before + 2)
2844+
})
2845+
.expect("Failed to advance chain tip");
2846+
2847+
// Sleep a bit more to ensure the signers see both burn blocks
28442848
sleep_ms(5_000);
28452849

28462850
info!("Unpause miner");
@@ -2882,13 +2886,9 @@ fn empty_sortition_before_proposal() {
28822886
info!("Found tenure extend block");
28832887
return Ok(true);
28842888
}
2885-
TenureChangeCause::BlockFound => {
2886-
info!("Found block with tenure change");
2887-
}
2889+
TenureChangeCause::BlockFound => {}
28882890
},
2889-
payload => {
2890-
info!("Found tx with payload: {:?}", payload);
2891-
}
2891+
_ => {}
28922892
};
28932893
}
28942894
Ok(false)

0 commit comments

Comments
 (0)