From 8e93155ed98eff1164c6daf506208f8971303171 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 28 Oct 2026 01:37:46 -0700 Subject: [PATCH] Tests: the idle cursor test renders every frame on the test thread the_canvas_hands_the_tool_cursor_to_the_os_and_idles_while_the_pointer_rests asserts that the window asks for no repaint once the pointer rests. On a loaded machine a canvas frame takes longer than 8 ms, so later frames go to the render worker, and a worker frame that finishes during the idle frames asks for a repaint (repaint delay 0, cause render_worker.rs:63). The test now sets canvas.worker_started, as the canvas tests do, so every frame renders on the test thread. --- crates/ui-egui/src/cursors/tests.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui-egui/src/cursors/tests.rs b/crates/ui-egui/src/cursors/tests.rs index 8319fe7c5..ece8895b4 100644 --- a/crates/ui-egui/src/cursors/tests.rs +++ b/crates/ui-egui/src/cursors/tests.rs @@ -334,6 +334,9 @@ fn focus_frame(app: &mut VectorcraftApp, ctx: &egui::Context, focused: bool, eve fn the_canvas_hands_the_tool_cursor_to_the_os_and_idles_while_the_pointer_rests() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + // Every frame renders on this thread, however long it takes: a frame finished by the render + // worker during the idle frames asks for a repaint. + app.canvas.worker_started = true; let ctx = egui::Context::default(); for _ in 0..3 { frame(&mut app, &ctx, vec![]);