From b7026deddc4f41110e9c6b35b805db5798147a07 Mon Sep 17 00:00:00 2001 From: Dominik Strebel Date: Sun, 25 Oct 2026 20:24:47 +0100 Subject: [PATCH] test(ui): the blocked-stdin Stop test waits for the agent's stop job --- crates/ui-egui/src/localagents.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/localagents.rs b/crates/ui-egui/src/localagents.rs index df38735d8..655256188 100644 --- a/crates/ui-egui/src/localagents.rs +++ b/crates/ui-egui/src/localagents.rs @@ -659,7 +659,13 @@ mod tests { let child = run.child.clone(); drop(run); super::finish_stops(); - assert!(child.lock().unwrap().as_mut().unwrap().try_wait().unwrap().is_some()); + // Another test's `finish_stops` may have taken this stop job and still be waiting on it, + // so the agent is stopped soon rather than at once. + let until = Instant::now() + Duration::from_secs(5); + while child.lock().unwrap().as_mut().unwrap().try_wait().unwrap().is_none() { + assert!(Instant::now() < until, "agent survived Stop"); + std::thread::sleep(Duration::from_millis(20)); + } relay.stop(); let _ = std::fs::remove_dir_all(work); }