Increase `cx.condition` timeout to fix flaky test (#28822)

João Marcos created

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

Change summary

crates/gpui/src/app/test_context.rs | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)

Detailed changes

crates/gpui/src/app/test_context.rs 🔗

@@ -589,11 +589,6 @@ impl<V> Entity<V> {
         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<V> Entity<V> {
         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();