fix(ci): Increase test launch and shutdown times to fix CI failures (#7499)

* Increase launch times to help fix failures in rpc_conflict and non_blocking_logger tests

* Add extra task spawn and shutdown logs to start.rs
This commit is contained in:
teor 2023-09-07 10:04:02 +10:00 committed by GitHub
parent c78d658bc5
commit 29d8e90ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -217,6 +217,7 @@ impl StartCmd {
}
// Launch RPC server
info!("spawning RPC server");
let (rpc_task_handle, rpc_tx_queue_task_handle, rpc_server) = RpcServer::spawn(
config.rpc.clone(),
config.mining.clone(),
@ -232,6 +233,7 @@ impl StartCmd {
);
// Start concurrent tasks which don't add load to other tasks
info!("spawning block gossip task");
let block_gossip_task_handle = tokio::spawn(
sync::gossip_best_tip_block_hashes(
sync_status.clone(),
@ -241,16 +243,20 @@ impl StartCmd {
.in_current_span(),
);
info!("spawning mempool queue checker task");
let mempool_queue_checker_task_handle = mempool::QueueChecker::spawn(mempool.clone());
info!("spawning mempool transaction gossip task");
let tx_gossip_task_handle = tokio::spawn(
mempool::gossip_mempool_transaction_id(mempool_transaction_receiver, peer_set.clone())
.in_current_span(),
);
info!("spawning delete old databases task");
let mut old_databases_task_handle =
zebra_state::check_and_delete_old_databases(config.state.clone());
info!("spawning progress logging task");
let progress_task_handle = tokio::spawn(
show_block_chain_progress(
config.network.network,
@ -260,6 +266,7 @@ impl StartCmd {
.in_current_span(),
);
info!("spawning end of support checking task");
let end_of_support_task_handle = tokio::spawn(
sync::end_of_support::start(config.network.network, latest_chain_tip).in_current_span(),
);
@ -270,6 +277,7 @@ impl StartCmd {
tokio::task::yield_now().await;
// The crawler only activates immediately in tests that use mempool debug mode
info!("spawning mempool crawler task");
let mempool_crawler_task_handle = mempool::Crawler::spawn(
&config.mempool,
peer_set,
@ -278,6 +286,7 @@ impl StartCmd {
chain_tip_change,
);
info!("spawning syncer task");
let syncer_task_handle = tokio::spawn(syncer.sync().in_current_span());
info!("spawned initial Zebra tasks");
@ -410,7 +419,7 @@ impl StartCmd {
}
};
info!("exiting Zebra because an ongoing task exited: stopping other tasks");
info!("exiting Zebra because an ongoing task exited: asking other tasks to stop");
// ongoing tasks
rpc_task_handle.abort();
@ -433,9 +442,12 @@ impl StartCmd {
//
// Without this shutdown, Zebra's RPC unit tests sometimes crashed with memory errors.
if let Some(rpc_server) = rpc_server {
info!("waiting for RPC server to shut down");
rpc_server.shutdown_blocking();
}
info!("exiting Zebra: all tasks have been asked to stop, waiting for remaining tasks to finish");
exit_status
}

View File

@ -35,7 +35,7 @@ use crate::common::{
///
/// Previously, this value was 3 seconds, which caused rare
/// metrics or tracing test failures in Windows CI.
pub const LAUNCH_DELAY: Duration = Duration::from_secs(15);
pub const LAUNCH_DELAY: Duration = Duration::from_secs(20);
/// After we launch `zebrad`, wait this long in extended tests.
/// See [`LAUNCH_DELAY`] for details.
@ -52,7 +52,7 @@ pub const LIGHTWALLETD_DELAY: Duration = Duration::from_secs(60);
///
/// We use a longer time to make sure the first node has launched before the second starts,
/// even if CI is under load.
pub const BETWEEN_NODES_DELAY: Duration = Duration::from_secs(5);
pub const BETWEEN_NODES_DELAY: Duration = Duration::from_secs(20);
/// The amount of time we wait for lightwalletd to update to the tip.
///