scheduler: Add missing constructs for Cloud (#37948)

This PR adds some missing constructs that are needed by Cloud to the
scheduler.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2025-09-10 22:02:23 +00:00
committed by GitHub
parent 2ce0641fe0
commit db367cc6bf
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -24,6 +24,11 @@ impl TestClock {
}))
}
pub fn set_utc_now(&self, now: DateTime<Utc>) {
let mut state = self.0.lock();
state.utc_now = now;
}
pub fn advance(&self, duration: Duration) {
let mut state = self.0.lock();
state.now += duration;
+6
View File
@@ -135,6 +135,12 @@ impl TestScheduler {
}
}
pub fn run_with_clock_advancement(&self) {
while self.step() || self.advance_clock_to_next_timer() {
// Continue until no work remains
}
}
fn step(&self) -> bool {
let elapsed_timers = {
let mut state = self.state.lock();