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
This commit is contained in:
João Marcos 2025-04-15 21:36:35 -03:00 committed by GitHub
parent 134a0563c2
commit 4e8ecfc0c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -589,11 +589,6 @@ impl<V> Entity<V> {
use postage::prelude::{Sink as _, Stream as _}; use postage::prelude::{Sink as _, Stream as _};
let (tx, mut rx) = postage::mpsc::channel(1024); 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 mut cx = cx.app.borrow_mut();
let subscriptions = ( let subscriptions = (
@ -615,7 +610,7 @@ impl<V> Entity<V> {
let handle = self.downgrade(); let handle = self.downgrade();
async move { async move {
crate::util::timeout(timeout_duration, async move { crate::util::timeout(Duration::from_secs(1), async move {
loop { loop {
{ {
let cx = cx.borrow(); let cx = cx.borrow();