diff --git a/crates/gpui/src/profiler/hang.rs b/crates/gpui/src/profiler/hang.rs index e251f64176b..03c2f302990 100644 --- a/crates/gpui/src/profiler/hang.rs +++ b/crates/gpui/src/profiler/hang.rs @@ -691,6 +691,10 @@ mod tests { fn app_flushes_its_hang_monitor_on_shutdown(cx: &mut TestAppContext) { use super::{HangMonitorConfig, HangMonitorPollReason}; + // The monitor runs on a real OS thread, so shutdown has to park until it + // finishes the flush, and its completion wakes the scheduler from that thread. + cx.executor().allow_parking(); + let (sender, receiver) = std::sync::mpsc::channel(); cx.update(|cx| { cx.start_hang_monitor(