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

chore(starknet_integration_tests): ensure late-joining node participates in consensus #3885

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::HashSet;
use std::time::Duration;

use mempool_test_utils::starknet_api_test_utils::{AccountId, MultiAccountTransactionGenerator};
use starknet_api::block::BlockNumber;
Expand All @@ -9,7 +10,7 @@ use crate::sequencer_manager::{get_sequencer_setup_configs, IntegrationTestManag
use crate::utils::InvokeTxs;

pub async fn end_to_end_integration(tx_generator: &mut MultiAccountTransactionGenerator) {
const EXPECTED_BLOCK_NUMBER: BlockNumber = BlockNumber(10);
const EXPECTED_BLOCK_NUMBER: BlockNumber = BlockNumber(5);
const LATE_NODE_EXPECTED_BLOCK_NUMBER: BlockNumber = BlockNumber(25);
const N_TXS: usize = 50;
const SENDER_ACCOUNT: AccountId = 0;
Expand Down Expand Up @@ -49,6 +50,12 @@ pub async fn end_to_end_integration(tx_generator: &mut MultiAccountTransactionGe
// Run the late node.
integration_test_manager.run(HashSet::from([1])).await;

// Shutdown the node with index 2 to ensure that the late-joining node (index 1) participates in
// the consensus.
info!("Sleeping for 30 seconds to allow the late node to join.");
tokio::time::sleep(Duration::from_secs(30)).await;
integration_test_manager.shutdown_nodes(HashSet::from([2]));

// Run the tests after the late node joins.
integration_test_manager
.test_and_verify(
Expand Down
Loading