From 612d01adec2c638121565b52d3b1a9811952e4a2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 27 Nov 2026 19:51:52 -0800 Subject: [PATCH] Tests: the Retype progress window test holds the app's clock still tests::retype_runs::the_progress_window_shows_a_search checked that the window is not shown before its delay while the app's clock ran on the monotonic clock. When 0.4 s passed between starting the search and the first frame, as on a loaded machine, the window was already due and the test failed with "not before the delay". The test now sets now_override to 0, as the trace, opening and placing progress-window tests do, and makes the search old enough by moving its start back. Its assertions are unchanged. --- crates/ui-egui/src/tests/retype_runs.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tests/retype_runs.rs b/crates/ui-egui/src/tests/retype_runs.rs index 946c94b865..8f27f1c572 100644 --- a/crates/ui-egui/src/tests/retype_runs.rs +++ b/crates/ui-egui/src/tests/retype_runs.rs @@ -98,12 +98,14 @@ fn cancel_changes_nothing() { #[test] fn the_progress_window_shows_a_search() { let (mut app, _) = outlined(); + // The app's clock stands still: the search is only old enough for its window when made so. + app.now_override = Some(0.0); let ctx = crate::testing::ui_context(); let before = undos(&app); crate::menus::invoke(&mut app, "type.retype", json!({})); assert!(app.retype_runs.running.is_some()); assert!(!progress(&mut app, &ctx, 0.0).contains("Finding matching fonts"), "not before the delay"); - // The delay counts on the monotonic clock: the search started that long ago. + // The delay counts on the app's clock: the search started that long ago. if let Some(r) = app.retype_runs.running.as_mut() { r.started -= DELAY; }