From 2fcc17eb35e467e457d37b54d84046d2a1d3e823 Mon Sep 17 00:00:00 2001 From: Liang-Ting Jiang Date: Sat, 25 Apr 2026 17:31:19 -0700 Subject: [PATCH] Stabilize throttled file watcher test --- codex-rs/core/src/file_watcher_tests.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codex-rs/core/src/file_watcher_tests.rs b/codex-rs/core/src/file_watcher_tests.rs index a989300ffc..1bc291fc2c 100644 --- a/codex-rs/core/src/file_watcher_tests.rs +++ b/codex-rs/core/src/file_watcher_tests.rs @@ -36,6 +36,11 @@ async fn throttled_receiver_coalesces_within_interval() { }) ); + // Reset the throttle window relative to "now" so this assertion does not + // depend on how much wall-clock time slow CI spent between the first recv + // and the second send. + throttled.next_allowed = Some(Instant::now() + TEST_THROTTLE_INTERVAL); + tx.add_changed_paths(&[path("b"), path("c")]).await; let blocked = timeout(TEST_THROTTLE_INTERVAL / 2, throttled.recv()).await; assert_eq!(blocked.is_err(), true);