@@ -2466,3 +2466,50 @@ async fn test_defer_comp_dynamic(executor: Rc<LocalExecutor<'static>>) -> anyhow
24662466 }
24672467 Ok ( ( ) )
24682468}
2469+
2470+ // TODO: TW there is a bug here with the typed async configuration - hence why I used the
2471+ // untyped only
2472+ #[ apply( async_test) ]
2473+ async fn test_benchmark_regression_long_add_defer (
2474+ executor : Rc < LocalExecutor < ' static > > ,
2475+ ) -> anyhow:: Result < ( ) > {
2476+ // Specifically we used to fail with size >= 2007
2477+ const SIZE : usize = 5000 ;
2478+ for config in TestConfiguration :: untyped_configurations ( ) {
2479+ let spec = lola_specification ( & mut spec_add_defer ( ) ) . unwrap ( ) ;
2480+
2481+ let input_streams = input_streams_add_defer ( SIZE ) ;
2482+
2483+ // Create output handler based on configuration
2484+ let mut output_handler = Box :: new ( ManualOutputHandler :: new (
2485+ executor. clone ( ) ,
2486+ spec. output_vars . clone ( ) ,
2487+ ) ) ;
2488+ let outputs = output_handler. get_output ( ) ;
2489+
2490+ // Build base monitor with common settings
2491+ let builder = RuntimeBuilder :: new ( )
2492+ . executor ( executor. clone ( ) )
2493+ . model ( spec. clone ( ) )
2494+ . input ( Box :: new ( input_streams) )
2495+ . output ( output_handler) ;
2496+
2497+ // Apply configuration-specific settings
2498+ let builder = create_builder_from_config ( builder, config) ;
2499+
2500+ let monitor = builder. build ( ) ;
2501+
2502+ // Run monitor and collect results
2503+ executor. spawn ( monitor. run ( ) ) . detach ( ) ;
2504+ let result: Vec < ( usize , Vec < Value > ) > = with_timeout (
2505+ outputs. take ( SIZE ) . enumerate ( ) . collect ( ) ,
2506+ 3 ,
2507+ format ! ( "outputs.collect with config: {:?}" , config) . as_str ( ) ,
2508+ )
2509+ . await ?;
2510+
2511+ // This test is just about not hanging
2512+ assert_eq ! ( result. len( ) , SIZE ) ;
2513+ }
2514+ Ok ( ( ) )
2515+ }
0 commit comments