Skip to content

Commit c6f3471

Browse files
committed
test: fix nakamoto_attempt_time test
Pause the miner iwhen submitting transactions so that all transactions intended to be in one block will be in the same block.
1 parent 6dd0150 commit c6f3471

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

testnet/stacks-node/src/tests/nakamoto_integrations.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6012,6 +6012,10 @@ fn nakamoto_attempt_time() {
60126012
break account;
60136013
};
60146014

6015+
// Stall the miner to make sure it waits until all transactions are
6016+
// submitted before it mines a block
6017+
TEST_MINE_STALL.set(true);
6018+
60156019
let mut sender_nonce = account.nonce;
60166020
for _ in 0..txs_per_block {
60176021
let transfer_tx = make_stacks_transfer(
@@ -6026,6 +6030,8 @@ fn nakamoto_attempt_time() {
60266030
submit_tx(&http_origin, &transfer_tx);
60276031
}
60286032

6033+
TEST_MINE_STALL.set(false);
6034+
60296035
// Miner should have made a new block by now
60306036
let wait_start = Instant::now();
60316037
loop {

0 commit comments

Comments
 (0)