From 3046cccab57b0049ecc3509dad0aef050ce3293c Mon Sep 17 00:00:00 2001 From: Daniil Polyakov Date: Fri, 29 May 2026 20:44:21 +0300 Subject: [PATCH] fix(integration_tests/indexer): adjust l2 to l1 timeout to satisfy CI one more time --- integration_tests/tests/indexer.rs | 2 +- integration_tests/tests/indexer_ffi.rs | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/integration_tests/tests/indexer.rs b/integration_tests/tests/indexer.rs index 6bac8bef..e3b3bc7b 100644 --- a/integration_tests/tests/indexer.rs +++ b/integration_tests/tests/indexer.rs @@ -20,7 +20,7 @@ use wallet::{ }; /// Maximum time to wait for the indexer to catch up to the sequencer. -const L2_TO_L1_TIMEOUT: Duration = Duration::from_mins(5); +const L2_TO_L1_TIMEOUT: Duration = Duration::from_mins(6); /// Poll the indexer until its last finalized block id reaches the sequencer's /// current last block id or until [`L2_TO_L1_TIMEOUT_MILLIS`] elapses. diff --git a/integration_tests/tests/indexer_ffi.rs b/integration_tests/tests/indexer_ffi.rs index 178b2640..8088b6cb 100644 --- a/integration_tests/tests/indexer_ffi.rs +++ b/integration_tests/tests/indexer_ffi.rs @@ -10,6 +10,7 @@ use std::{ fs::File, io::Write as _, net::SocketAddr, + time::Duration, }; use anyhow::{Context as _, Result}; @@ -34,7 +35,7 @@ use wallet::{ }; /// Maximum time to wait for the indexer to catch up to the sequencer. -const L2_TO_L1_TIMEOUT_MILLIS: u64 = 180_000; +const L2_TO_L1_TIMEOUT: Duration = Duration::from_mins(6); unsafe extern "C" { unsafe fn query_last_block( @@ -114,7 +115,7 @@ fn indexer_test_run_ffi() -> Result<()> { let (ctx, indexer_ffi, _indexer_dir) = setup()?; // RUN OBSERVATION - std::thread::sleep(std::time::Duration::from_millis(L2_TO_L1_TIMEOUT_MILLIS)); + std::thread::sleep(L2_TO_L1_TIMEOUT); // Safety: ctx runtime is valid for the lifetime of the returned Runtime let runtime = unsafe { Runtime::from_borrowed(ctx.runtime()) }; @@ -138,7 +139,7 @@ fn indexer_ffi_block_batching() -> Result<()> { // WAIT info!("Waiting for indexer to parse blocks"); - std::thread::sleep(std::time::Duration::from_millis(L2_TO_L1_TIMEOUT_MILLIS)); + std::thread::sleep(L2_TO_L1_TIMEOUT); // Safety: ctx runtime is valid for the lifetime of the returned Runtime let runtime = unsafe { Runtime::from_borrowed(ctx.runtime()) }; @@ -265,7 +266,7 @@ fn indexer_ffi_state_consistency() -> Result<()> { // WAIT info!("Waiting for indexer to parse blocks"); - std::thread::sleep(std::time::Duration::from_millis(L2_TO_L1_TIMEOUT_MILLIS)); + std::thread::sleep(L2_TO_L1_TIMEOUT); // Safety: ctx runtime is valid for the lifetime of the returned Runtime let runtime = unsafe { Runtime::from_borrowed(ctx.runtime()) }; @@ -371,7 +372,7 @@ fn indexer_ffi_state_consistency_with_labels() -> Result<()> { assert_eq!(acc_2_balance, 20100); info!("Waiting for indexer to parse blocks"); - std::thread::sleep(std::time::Duration::from_millis(L2_TO_L1_TIMEOUT_MILLIS)); + std::thread::sleep(L2_TO_L1_TIMEOUT); // Safety: ctx runtime is valid for the lifetime of the returned Runtime let runtime = unsafe { Runtime::from_borrowed(ctx.runtime()) };