@@ -2530,9 +2530,9 @@ mod tests {
2530
2530
sandboxed_execution_controller_dir_and_path ( active, spawn_monitor_thread) ;
2531
2531
add_controller_backends ( & mut controller, 0 , active, 0 , 0 ) ;
2532
2532
2533
- // Trigger the monitoring and wait for the monitoring results.
2534
- let _ = controller . stop_monitoring_thread . send ( false ) ;
2535
- for _ in 0 .. 10_000 {
2533
+ for _ in 0 .. 1_000 {
2534
+ // Trigger the monitoring and wait for the monitoring results.
2535
+ controller . stop_monitoring_thread . send ( false ) . unwrap ( ) ;
2536
2536
let stats = get_sandbox_process_stats ( & controller. backends ) ;
2537
2537
if stats[ 0 ] . 2 . rss != DEFAULT_SANDBOX_PROCESS_RSS {
2538
2538
break ;
@@ -2573,12 +2573,14 @@ mod tests {
2573
2573
2574
2574
add_controller_backends ( & mut controller, 0 , active, evicted, 0 ) ;
2575
2575
2576
- // Trigger the monitoring twice and wait for the monitoring results.
2577
- let _ = controller. stop_monitoring_thread . send ( false ) ;
2578
- let _ = controller. stop_monitoring_thread . send ( false ) ;
2579
- for _ in 0 ..10_000 {
2576
+ for _ in 0 ..1_000 {
2577
+ // Trigger the monitoring and wait for the monitoring results.
2578
+ controller. stop_monitoring_thread . send ( false ) . unwrap ( ) ;
2580
2579
let m = & controller. metrics ;
2581
- if m. sandboxed_execution_subprocess_anon_rss . get_sample_count ( ) > 1 {
2580
+ if m. sandboxed_execution_subprocess_active_last_used
2581
+ . get_sample_count ( )
2582
+ > 0
2583
+ {
2582
2584
break ;
2583
2585
}
2584
2586
thread:: sleep ( Duration :: from_millis ( 10 ) ) ;
0 commit comments