Skip to content

Commit 84df8fb

Browse files
committed
test: another attempt at de-flaking
1 parent b8ecf19 commit 84df8fb

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ use stacks_signer::{Signer, SpawnedSigner};
6060
use super::nakamoto_integrations::{
6161
check_nakamoto_empty_block_heuristics, next_block_and, wait_for,
6262
};
63-
use super::neon_integrations::{get_account, get_sortition_info_ch, submit_tx_fallible};
63+
use super::neon_integrations::{get_account, get_sortition_info_ch, submit_tx_fallible, Account};
6464
use crate::neon::Counters;
6565
use crate::run_loop::boot_nakamoto;
6666
use crate::tests::bitcoin_regtest::BitcoinCoreController;
@@ -476,6 +476,11 @@ impl<S: Signer<T> + Send + 'static, T: SignerEventTrait + 'static> SignerTest<Sp
476476
submit_tx_fallible(&http_origin, &contract_tx).map(|resp| (resp, sender_nonce))
477477
}
478478

479+
pub fn get_account<F: std::fmt::Display>(&self, account: &F) -> Account {
480+
let http_origin = format!("http://{}", &self.running_nodes.conf.node.rpc_bind);
481+
get_account(&http_origin, account)
482+
}
483+
479484
/// Submit a contract call and return (txid, sender_nonce)
480485
pub fn submit_contract_call(
481486
&self,

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use stacks::config::{Config as NeonConfig, EventKeyType, EventObserverConfig};
5151
use stacks::core::mempool::MemPoolWalkStrategy;
5252
use stacks::core::test_util::{
5353
insert_tx_in_mempool, make_contract_call, make_contract_publish,
54-
make_stacks_transfer_serialized,
54+
make_stacks_transfer_serialized, to_addr,
5555
};
5656
use stacks::core::{StacksEpochId, CHAIN_ID_TESTNET};
5757
use stacks::libstackerdb::StackerDBChunkData;
@@ -15424,6 +15424,11 @@ fn bitcoin_reorg_extended_tenure() {
1542415424
.expect("Timed out waiting for contract-call");
1542515425
}
1542615426

15427+
let last_nonce = miners
15428+
.signer_test
15429+
.get_account(&to_addr(&miners.sender_sk))
15430+
.nonce;
15431+
1542715432
info!("------------------------- Triggering Bitcoin Fork -------------------------");
1542815433

1542915434
let burn_block_height = get_chain_info(&conf_1).burn_block_height;
@@ -15460,12 +15465,14 @@ fn bitcoin_reorg_extended_tenure() {
1546015465

1546115466
info!("Chain info after fork: {:?}", get_chain_info(&conf_1));
1546215467

15463-
// get at least one block produced before we stall broadcasts
15468+
// get blocks produced with the "reorged" txs before we stall broadcasts
1546415469
// to check signer approvals
1546515470
miners
1546615471
.signer_test
15467-
.submit_burn_block_call_and_wait(&miners.sender_sk)
15468-
.expect("Timed out waiting for contract-call");
15472+
.wait_for_nonce_increase(&to_addr(&miners.sender_sk), last_nonce - 1)
15473+
.unwrap();
15474+
15475+
miners.wait_for_chains(60);
1546915476

1547015477
// stall p2p broadcast and signer block announcements
1547115478
// so that we can ensure all the signers approve the proposal

0 commit comments

Comments
 (0)