Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Restore run_with_clock_advancement (#46930)

Conrad Irwinfcd80dd972f1
diff --git a/crates/scheduler/src/test_scheduler.rs b/crates/scheduler/src/test_scheduler.rs
index fcc6e5c1e7d..e69d3419cf4 100644
--- a/crates/scheduler/src/test_scheduler.rs
+++ b/crates/scheduler/src/test_scheduler.rs
@@ -177,6 +177,12 @@ impl TestScheduler {
}
}
+ pub fn run_with_clock_advancement(&self) {
+ while self.step() || self.advance_clock_to_next_timer() {
+ // Continue until no work remains
+ }
+ }
+
/// Execute one tick of the scheduler, processing expired timers and running
/// at most one task. Returns true if any work was done.
///