Skip to content

Commit fb2a707

Browse files
committed
test: fix reward-cycle flake in multiple_miners_empty_sortition
1 parent 60634c2 commit fb2a707

File tree

1 file changed

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

1 file changed

+12
-2
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ use crate::tests::nakamoto_integrations::{
8585
POX_4_DEFAULT_STACKER_BALANCE, POX_4_DEFAULT_STACKER_STX_AMT,
8686
};
8787
use crate::tests::neon_integrations::{
88-
get_account, get_chain_info, get_chain_info_opt, get_sortition_info, get_sortition_info_ch,
89-
next_block_and_wait, run_until_burnchain_height, submit_tx, submit_tx_fallible, test_observer,
88+
get_account, get_chain_info, get_chain_info_opt, get_pox_info, get_sortition_info,
89+
get_sortition_info_ch, next_block_and_wait, run_until_burnchain_height, submit_tx,
90+
submit_tx_fallible, test_observer,
9091
};
9192
use crate::tests::{
9293
self, gen_random_port, make_contract_call, make_contract_publish, make_stacks_transfer,
@@ -11729,6 +11730,15 @@ fn multiple_miners_empty_sortition() {
1172911730
let last_active_sortition = get_sortition_info(&conf);
1173011731
assert!(last_active_sortition.was_sortition);
1173111732

11733+
// check if we're about to cross a reward cycle boundary -- if so, we can't
11734+
// perform this test, because we can't tenure extend across the boundary
11735+
let pox_info = get_pox_info(&conf.node.data_url).unwrap();
11736+
let blocks_until_next_cycle = pox_info.next_cycle.blocks_until_reward_phase;
11737+
if blocks_until_next_cycle == 1 {
11738+
info!("We're about to cross a reward cycle boundary, cannot perform a tenure extend here!");
11739+
continue;
11740+
}
11741+
1173211742
// lets mine a btc flash block
1173311743
let rl2_commits_before = rl2_commits.load(Ordering::SeqCst);
1173411744
let rl1_commits_before = rl1_commits.load(Ordering::SeqCst);

0 commit comments

Comments
 (0)