From b15fe91627246bc54aac4b28a8ba3f708d10cfcf Mon Sep 17 00:00:00 2001 From: mtlcl410 <2368091+mtlcl410@users.noreply.github.com> Date: Sun, 18 Oct 2026 01:19:28 +0800 Subject: [PATCH] test: the image-drag pixel test waits for the page raster image_pixels_follow_the_frame_while_a_corner_is_dragged drags before the asynchronous page raster has arrived on a slow runner, and the preview (drawn from that raster) then draws no picture: 'not only at []' on windows-latest for #3070 and #3071 (a deny.toml-only change). With a 300 ms render delay added locally, main's test fails the same way and this one passes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RUNQSPVXx3dDBabRZHAnjz --- crates/ui-egui/tests/editing.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/ui-egui/tests/editing.rs b/crates/ui-egui/tests/editing.rs index f8db52575..570b84750 100644 --- a/crates/ui-egui/tests/editing.rs +++ b/crates/ui-egui/tests/editing.rs @@ -4197,6 +4197,16 @@ fn image_pixels_follow_the_frame_while_a_corner_is_dragged() { assert!(h.state_mut().execute("edit.edit_text")); h.state_mut().views[0].set_zoom(1.2); h.run_steps(4); + // The dragged pixels are the page raster's: wait for it, as a slow runner may not have it yet + // (the drag then drew no picture at all). + for _ in 0..400 { + h.run_steps(1); + if !h.state().render_pending() { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + } + assert!(!h.state().render_pending(), "the page raster arrives"); let page = h.state().views[0].page_screen_rect(0).unwrap(); let at = |x: f32, y: f32| egui::pos2(page.left() + x / 200.0 * page.width(), page.top() + (300.0 - y) / 300.0 * page.height()); let p = at(95.0, 195.0);