diff --git a/crates/services/src/async_processor.rs b/crates/services/src/async_processor.rs index 6a5b43f395f..383bfc150c2 100644 --- a/crates/services/src/async_processor.rs +++ b/crates/services/src/async_processor.rs @@ -287,6 +287,7 @@ mod tests { // Then while broadcast_receiver.recv().await.is_ok() {} + tokio::task::yield_now().await; assert!(instant.elapsed() <= Duration::from_secs(2)); let duration = Duration::from_nanos(heavy_task_processor.metric.busy.get()); assert_eq!(duration.as_secs(), 0);