mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-28 16:50:26 +00:00
The inbuilt `tokio::time::sleep` method works in production, but breaks when in unit tests where time is set via the virtual time. We add `tokio::time::sleep` to the disallowed-methods clippy lint, pointing at the correct method to use. We also change how the virtual test times work. We keep the global test time set within Python unit tests, but also introduce per-clock virtual times. In Python only one test runs at once (within a process), but on Rust multiple tests can run at once, and so we need to be careful not to use a process-global virtual time for rust tests.