Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce test flakiness in CI #3743

Merged
merged 4 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions testnet/stacks-node/src/tests/epoch_22.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ fn pox_2_unlock_all() {
// *now* advance to 2.1
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);

info!("Test passed processing 2.1");

Expand Down Expand Up @@ -845,6 +846,7 @@ fn pox_2_unlock_all() {
);

info!("Submit 2.1 stacking tx to {:?}", &http_origin);
sleep_ms(5_000);
submit_tx(&http_origin, &tx);

let tx = make_contract_call(
Expand Down
3 changes: 3 additions & 0 deletions testnet/stacks-node/src/tests/epoch_23.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use std::thread;

use stacks::burnchains::Burnchain;
use stacks::core::STACKS_EPOCH_MAX;
use stacks::util::sleep_ms;
use stacks::vm::types::QualifiedContractIdentifier;

use crate::config::EventKeyType;
Expand Down Expand Up @@ -436,6 +437,8 @@ fn trait_invocation_behavior() {
// stacks node to mine the stacks block which will be included in
// epoch_2_3 - 1, so these are the last transactions processed pre-2.3.
next_block_and_wait(&mut btc_regtest_controller, &blocks_processed);
// this sleep is placed here to reduce test flakiness
sleep_ms(10_000);

let tx_3 = make_contract_call(
&spender_sk,
Expand Down
11 changes: 8 additions & 3 deletions testnet/stacks-node/src/tests/neon_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2046,8 +2046,6 @@ fn bitcoind_resubmission_test() {

let (consensus_hash, stacks_block) = get_tip_anchored_block(&conf);

// let tip_hash = StacksBlockId::new(&consensus_hash, &stacks_block.header.block_hash());

let ublock_privk =
find_microblock_privkey(&conf, &stacks_block.header.microblock_pubkey_hash, 1024)
.unwrap();
Expand Down Expand Up @@ -9636,8 +9634,13 @@ fn test_problematic_microblocks_are_not_mined() {
let (mut new_files, cur_files_new) = find_new_files(bad_blocks_dir, &cur_files_old);
all_new_files.append(&mut new_files);
cur_files = cur_files_new;

// give the microblock miner a chance
sleep_ms(5_000);
}

// sleep a little longer before checking tip info; this should help with test flakiness
sleep_ms(10_000);
let tip_info = get_chain_info(&conf);

// all microblocks were processed
Expand All @@ -9664,7 +9667,7 @@ fn test_problematic_microblocks_are_not_mined() {
let tx_bytes = hex_bytes(&raw_tx[2..]).unwrap();
let parsed = StacksTransaction::consensus_deserialize(&mut &tx_bytes[..]).unwrap();
if let TransactionPayload::SmartContract(..) = &parsed.payload {
assert!(parsed.txid() != tx_high_txid);
assert_ne!(parsed.txid(), tx_high_txid);
}
}
}
Expand Down Expand Up @@ -10042,6 +10045,8 @@ fn test_problematic_microblocks_are_not_relayed_or_stored() {
sleep_ms(5_000);
}

// sleep a little longer before checking tip info; this should help with test flakiness
sleep_ms(10_000);
let tip_info = get_chain_info(&conf);

// all microblocks were processed
Expand Down