From 4e8ecfc0c4a095138a0d50f8cba201e12ae0f2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Marcos?= Date: Tue, 15 Apr 2025 21:36:35 -0300 Subject: [PATCH] Increase `cx.condition` timeout to fix flaky test (#28822) We've been seeing `test_no_duplicated_completion_requests` fail randomly with the error "condition timed out". But it's always failing on MacOS, and MacOS sets a shorter timeout of 100ms, compared to 1s from other platforms, this PR increases MacOS's timeout to match other platforms'. Release Notes: - N/A --- crates/gpui/src/app/test_context.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/gpui/src/app/test_context.rs b/crates/gpui/src/app/test_context.rs index be36324c0f7d6dcddfde1a59700d0c723be4b547..2de8a9dbbe012d84be6787fd0e51a80f81ef4472 100644 --- a/crates/gpui/src/app/test_context.rs +++ b/crates/gpui/src/app/test_context.rs @@ -589,11 +589,6 @@ impl Entity { use postage::prelude::{Sink as _, Stream as _}; let (tx, mut rx) = postage::mpsc::channel(1024); - let timeout_duration = if cfg!(target_os = "macos") { - Duration::from_millis(100) - } else { - Duration::from_secs(1) - }; let mut cx = cx.app.borrow_mut(); let subscriptions = ( @@ -615,7 +610,7 @@ impl Entity { let handle = self.downgrade(); async move { - crate::util::timeout(timeout_duration, async move { + crate::util::timeout(Duration::from_secs(1), async move { loop { { let cx = cx.borrow();