From 725c5941d08840e4bca47f3ca59b8529502c1c5e Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Sun, 6 Dec 2026 14:04:24 +0800 Subject: [PATCH] test(task): tell the first delay from the interval after a change The case used a plan whose first delay equalled its interval, so re-arming at the full interval passed as well. In production the first delay is the remaining time and the interval is the full period, so the test now uses different values. --- crates/clash-verge-task/tests/timers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/clash-verge-task/tests/timers.rs b/crates/clash-verge-task/tests/timers.rs index 4a4f2331c..bf349f538 100644 --- a/crates/clash-verge-task/tests/timers.rs +++ b/crates/clash-verge-task/tests/timers.rs @@ -120,7 +120,7 @@ async fn an_idle_timer_with_a_changed_interval_fires_after_the_new_first_delay() let mut timers = KeyedTimers::new(); timers.apply(HashMap::from([("a".to_owned(), plan(60 * MINUTE, 60 * MINUTE))])); assert_eq!( - timers.apply(HashMap::from([("a".to_owned(), plan(MINUTE, MINUTE))])), + timers.apply(HashMap::from([("a".to_owned(), plan(MINUTE, 90 * MINUTE))])), vec![TimerChange::Updated("a".to_owned())] ); assert!(nothing_due(&mut timers).await, "a changed timer does not fire at once");