diff --git a/crates/gpui2/src/app/test_context.rs b/crates/gpui2/src/app/test_context.rs index 5397a2214d..37f81da15b 100644 --- a/crates/gpui2/src/app/test_context.rs +++ b/crates/gpui2/src/app/test_context.rs @@ -354,10 +354,18 @@ impl Model { }) }); - cx.executor().run_until_parked(); - rx.try_next() - .expect("no event received") - .expect("model was dropped") + loop { + match rx.try_next() { + Ok(Some(event)) => return event, + Ok(None) => panic!("model was dropped"), + Err(_) => { + if !cx.executor().run_step() { + break; + } + } + } + } + panic!("no event received") } }