From b15928220f53818164c2cd4e2c236d5c1f5aada6 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Tue, 25 Aug 2026 14:30:49 +0800 Subject: [PATCH] test(ecstore): avoid virtual timeout for sync batch (#6551) --- crates/ecstore/src/disk/os.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/ecstore/src/disk/os.rs b/crates/ecstore/src/disk/os.rs index 7e6a92557..b8d8724d9 100644 --- a/crates/ecstore/src/disk/os.rs +++ b/crates/ecstore/src/disk/os.rs @@ -6370,8 +6370,15 @@ mod tests { .await .expect("second waiter should enqueue during the configured wait budget"); tokio::time::advance(wait_budget).await; - tokio::task::yield_now().await; - file_sync_probe::wait_for_active(1).await; + let batch_deadline = std::time::Instant::now() + Duration::from_secs(30); + while file_sync_probe::group_batches().is_empty() { + assert!( + std::time::Instant::now() < batch_deadline, + "timed out waiting for the wait-budget group batch; counts={:?}", + file_fdatasync_group_commit_counts_for_test() + ); + tokio::task::yield_now().await; + } assert_eq!( file_sync_probe::group_batches(),