Skip to content

fix(apollo_integration_tests): increase tps and number of blocks to wait #6354

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tracing::info;
#[tokio::main]
async fn main() {
integration_test_setup("positive").await;
const BLOCK_TO_WAIT_FOR: BlockNumber = BlockNumber(15);
const BLOCK_TO_WAIT_FOR: BlockNumber = BlockNumber(30);
const N_INVOKE_TXS: usize = 50;
const N_L1_HANDLER_TXS: usize = 2;
/// The number of consolidated local sequencers that participate in the test.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use tracing::info;
async fn main() {
integration_test_setup("restart").await;
const TOTAL_PHASES: u64 = 4;
const PHASE_DURATION: Duration = Duration::from_secs(45);
const PHASE_DURATION: Duration = Duration::from_secs(30);
const TOTAL_DURATION: u64 = PHASE_DURATION.as_secs() * TOTAL_PHASES;
const TOTAL_INVOKE_TXS: u64 = TPS * TOTAL_DURATION;
/// The number of consolidated local sequencers that participate in the test.
Expand Down Expand Up @@ -112,7 +112,7 @@ async fn main() {
"Awaiting transactions after node {RESTART_NODE} was restarted and before node \
{SHUTDOWN_NODE} is shut down"
);
sleep(PHASE_DURATION).await;
sleep(PHASE_DURATION * 3).await;
verify_running_nodes_received_more_txs(
&mut nodes_accepted_txs_mapping,
&integration_test_manager,
Expand All @@ -129,7 +129,7 @@ async fn main() {
"Awaiting transactions while node {RESTART_NODE} is up and node {SHUTDOWN_NODE} is \
down"
);
sleep(PHASE_DURATION).await;
sleep(PHASE_DURATION * 3).await;
verify_running_nodes_received_more_txs(
&mut nodes_accepted_txs_mapping,
&integration_test_manager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ use tracing::info;
#[tokio::main]
async fn main() {
integration_test_setup("revert").await;
const BLOCK_TO_REVERT_FROM: BlockNumber = BlockNumber(15);
const BLOCK_TO_REVERT_FROM: BlockNumber = BlockNumber(30);
const REVERT_UP_TO_AND_INCLUDING: BlockNumber = BlockNumber(1);
const BLOCK_TO_WAIT_FOR_AFTER_REVERT: BlockNumber = BlockNumber(20);
const BLOCK_TO_WAIT_FOR_AFTER_REVERT: BlockNumber = BlockNumber(40);
// can't use static assertion as comparison is non const.
assert!(REVERT_UP_TO_AND_INCLUDING < BLOCK_TO_REVERT_FROM);
assert!(BLOCK_TO_REVERT_FROM < BLOCK_TO_WAIT_FOR_AFTER_REVERT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ use crate::utils::{

pub const DEFAULT_SENDER_ACCOUNT: AccountId = 0;
const BLOCK_MAX_CAPACITY_N_STEPS: GasAmount = GasAmount(30000000);
pub const BLOCK_TO_WAIT_FOR_DEPLOY_AND_INVOKE: BlockNumber = BlockNumber(2);
pub const BLOCK_TO_WAIT_FOR_DEPLOY_AND_INVOKE: BlockNumber = BlockNumber(4);
pub const BLOCK_TO_WAIT_FOR_DECLARE: BlockNumber =
BlockNumber(BLOCK_TO_WAIT_FOR_DEPLOY_AND_INVOKE.0 + 5);
BlockNumber(BLOCK_TO_WAIT_FOR_DEPLOY_AND_INVOKE.0 + 10);

pub const HTTP_PORT_ARG: &str = "http-port";
pub const MONITORING_PORT_ARG: &str = "monitoring-port";
Expand Down
4 changes: 2 additions & 2 deletions crates/apollo_integration_tests/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ pub const ACCOUNT_ID_0: AccountId = 0;
pub const ACCOUNT_ID_1: AccountId = 1;
pub const NEW_ACCOUNT_SALT: ContractAddressSalt = ContractAddressSalt(Felt::THREE);
pub const UNDEPLOYED_ACCOUNT_ID: AccountId = 2;
// Transactions per second sent to the gateway. This rate makes each block contain ~10 transactions
// Transactions per second sent to the gateway. This rate makes each block contain ~25 transactions
// with the set [TimeoutsConfig] .
pub const TPS: u64 = 2;
pub const TPS: u64 = 5;
pub const N_TXS_IN_FIRST_BLOCK: usize = 2;

pub type CreateRpcTxsFn = fn(&mut MultiAccountTransactionGenerator) -> Vec<RpcTransaction>;
Expand Down
6 changes: 5 additions & 1 deletion scripts/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
from enum import Enum
import os
import subprocess
from typing import List, Set, Optional
from tests_utils import (
Expand Down Expand Up @@ -114,7 +115,10 @@ def test_crates(crates: Set[str], base_command: BaseCommand, is_nightly: bool):
print("Executing test commands...")
for cmd in cmds:
print(cmd, flush=True)
subprocess.run(cmd, check=True)
# Copy current environment and add new variable
env = os.environ.copy()
env["RUST_LOG"] = "debug"
subprocess.run(cmd, check=True, env=env)
print("Tests complete.")


Expand Down
Loading