@@ -9,8 +9,16 @@ use rollup_node_chain_orchestrator::ChainOrchestratorEvent;
99use rollup_node_primitives:: ChainImport ;
1010use tokio:: time:: timeout;
1111
12- /// The default event wait time.
13- pub const DEFAULT_EVENT_WAIT_TIMEOUT : Duration = Duration :: from_secs ( 180 ) ;
12+ /// Get the default event wait timeout.
13+ /// Checks the `CI_EVENT_TIMEOUT` environment variable at runtime.
14+ /// Defaults to 30 seconds if not set.
15+ pub fn default_event_wait_timeout ( ) -> Duration {
16+ std:: env:: var ( "CI_EVENT_TIMEOUT" )
17+ . ok ( )
18+ . and_then ( |s| s. parse :: < u64 > ( ) . ok ( ) )
19+ . map ( Duration :: from_secs)
20+ . unwrap_or ( Duration :: from_secs ( 30 ) )
21+ }
1422
1523/// Builder for waiting for events on multiple nodes.
1624#[ derive( Debug ) ]
@@ -22,8 +30,8 @@ pub struct EventWaiter<'a> {
2230
2331impl < ' a > EventWaiter < ' a > {
2432 /// Create a new multi-node event waiter.
25- pub const fn new ( fixture : & ' a mut TestFixture , node_indices : Vec < usize > ) -> Self {
26- Self { fixture, node_indices, timeout_duration : Duration :: from_secs ( 30 ) }
33+ pub fn new ( fixture : & ' a mut TestFixture , node_indices : Vec < usize > ) -> Self {
34+ Self { fixture, node_indices, timeout_duration : default_event_wait_timeout ( ) }
2735 }
2836
2937 /// Set a custom timeout for waiting.
0 commit comments