scheduler: Add missing constructs for Cloud (#37948)

Marshall Bowers created

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

Release Notes:

- N/A

Change summary

crates/scheduler/src/clock.rs          | 5 +++++
crates/scheduler/src/test_scheduler.rs | 6 ++++++
2 files changed, 11 insertions(+)

Detailed changes

crates/scheduler/src/clock.rs 🔗

@@ -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;

crates/scheduler/src/test_scheduler.rs 🔗

@@ -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();