From f139b9ae0e8d98dc98e1dec6bb0fc427d36ccefa Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 20:27:26 +0000 Subject: time: the virtual clock freezes, it does not race Advancing the clock on every wait made virtual time outrun real work: a build taking a few hundred ms would burn forty ticks and expire its own lease. Under a virtual clock a wait now costs a yield and the clock only moves when a test moves it with time::advance, so a frozen lease stays frozen however fast the loop runs. --- tests/production_surface.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/production_surface.rs b/tests/production_surface.rs index 038a036..bcf3e92 100644 --- a/tests/production_surface.rs +++ b/tests/production_surface.rs @@ -166,8 +166,8 @@ fn the_virtual_clock_is_compiled_out_without_test_support() { .nth(1) .expect("without test-support there must be a clock module that is always real"); assert!( - fallback.contains("pub fn advance(_d: Duration) -> bool") && fallback.contains("false"), - "the fallback advance() must be a constant false so the seam compiles to a plain sleep" + fallback.contains("pub fn virtual_sleep() -> bool") && fallback.contains("false"), + "the fallback must report a real wait so the seam compiles to a plain sleep" ); assert!( !fallback.contains("Mutex"), -- cgit v1.2.3