Skip to content

Commit

Permalink
Make tests not flaky
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Murzin <[email protected]>
  • Loading branch information
dima74 authored and mversic committed Jun 10, 2024
1 parent c2f290c commit 09665d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/tests/integration/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ fn executor_upgrade_should_revoke_removed_permissions() -> Result<()> {
fn executor_custom_instructions_simple() -> Result<()> {
use executor_custom_data_model::simple::{CustomInstructionBox, MintAssetForAllAccounts};

let (_rt, _peer, client) = <PeerBuilder>::new().with_port(11_170).start_with_runtime();
let (_rt, _peer, client) = <PeerBuilder>::new().with_port(11_270).start_with_runtime();
wait_for_genesis_committed(&vec![client.clone()], 0);

upgrade_executor(
Expand Down Expand Up @@ -252,7 +252,7 @@ fn executor_custom_instructions_complex() -> Result<()> {
config.chain_wide.executor_runtime.fuel_limit = 1_000_000_000;

let (_rt, _peer, client) = PeerBuilder::new()
.with_port(11_185)
.with_port(11_275)
.with_config(config)
.start_with_runtime();
wait_for_genesis_committed(&vec![client.clone()], 0);
Expand Down
9 changes: 7 additions & 2 deletions core/test_network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -782,15 +782,20 @@ impl TestConfig for Config {
}
}

// Increased timeout to prevent flaky tests
const TRANSACTION_STATUS_TIMEOUT: Duration = Duration::from_secs(150);

impl TestClientConfig for ClientConfig {
fn test(api_address: &SocketAddr) -> Self {
iroha::samples::get_client_config(
let mut config = iroha::samples::get_client_config(
get_chain_id(),
get_key_pair(Signatory::Alice),
format!("http://{api_address}")
.parse()
.expect("should be valid url"),
)
);
config.transaction_status_timeout = TRANSACTION_STATUS_TIMEOUT;
config
}
}

Expand Down

0 comments on commit 09665d4

Please sign in to comment.