diff options
| author | aur-build <aur-build@localhost> | 2026-11-19 20:27:26 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-19 20:27:26 +0000 |
| commit | f139b9ae0e8d98dc98e1dec6bb0fc427d36ccefa (patch) | |
| tree | b4f075f3dd2164a7cf4d0f40e2447a30d1e40aff /tests/production_surface.rs | |
| parent | 985650c4586a8f96b7356518f5d7a19aa80789fe (diff) | |
| download | aur-build-f139b9ae0e8d98dc98e1dec6bb0fc427d36ccefa.tar.gz aur-build-f139b9ae0e8d98dc98e1dec6bb0fc427d36ccefa.zip | |
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.
Diffstat (limited to 'tests/production_surface.rs')
| -rw-r--r-- | tests/production_surface.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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"), |
