Skip to content

Commit 5b90512

Browse files
committed
fix: deflake //rs/rosetta-api/icrc1:icrc_multitoken_rosetta_system_tests/multitoken_system_tests
Increase timeouts to handle resource contention when 4 tests run in parallel: 1. Increase MAX_ATTEMPTS in wait_for_rosetta_block from 20 to 60 (20s -> 60s) to give Rosetta more time to sync blocks under load. 2. Create RosettaClient with an explicit 120s timeout (instead of None which defaults to 60s) so make_submit_and_wait_for_transaction has sufficient time to find submitted transactions. Root cause: With RUST_TEST_THREADS=4, multiple Rosetta + PocketIC instances compete for resources, causing block sync and transaction confirmation to take longer than the previous tight timeouts allowed.
1 parent 31ca9d3 commit 5b90512

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

rs/rosetta-api/icrc1/tests/common/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub async fn wait_for_rosetta_block(
6363
network_identifier: NetworkIdentifier,
6464
block_index: u64,
6565
) -> Option<u64> {
66-
const MAX_ATTEMPTS: u8 = 20;
66+
const MAX_ATTEMPTS: u8 = 60;
6767
let mut last_block = None;
6868
for _ in 0..MAX_ATTEMPTS {
6969
let response = rosetta_client.ready().await;

rs/rosetta-api/icrc1/tests/multitoken_system_tests.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,11 @@ impl RosettaTestingEnvironmentBuilder {
401401
)
402402
.await;
403403

404-
let rosetta_client =
405-
RosettaClient::from_str_url(&format!("http://0.0.0.0:{}", rosetta_context.port))
406-
.expect("Unable to parse url");
404+
let rosetta_client = RosettaClient::from_str_url_and_timeout(
405+
&format!("http://0.0.0.0:{}", rosetta_context.port),
406+
Duration::from_secs(120),
407+
)
408+
.expect("Unable to parse url");
407409

408410
let rosetta_ledger_testing_envs = futures::future::join_all(
409411
self.rosetta_ledger_testing_env_builders

0 commit comments

Comments
 (0)