From 887f59c7a3082ba276056ca0437c8fbd36d0553d Mon Sep 17 00:00:00 2001 From: bflatastic Date: Fri, 6 Nov 2026 05:31:56 +0700 Subject: [PATCH] Tests: the first-frame worker test tolerates another test's placed document The frame key holds the process-wide placed-document generation, so a test running beside this one could make a new frame between the two it compares. --- crates/ui-egui/src/canvas/tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas/tests.rs b/crates/ui-egui/src/canvas/tests.rs index a09c62635..9d5b3e882 100644 --- a/crates/ui-egui/src/canvas/tests.rs +++ b/crates/ui-egui/src/canvas/tests.rs @@ -9223,7 +9223,9 @@ fn a_documents_first_frame_renders_on_the_worker() { let job = jobs.try_recv().expect("the first frame is queued on the worker"); assert!(app.canvas.texture.is_none(), "not rendered on the UI thread"); frame(&mut app); - assert!(jobs.try_recv().is_err(), "not queued again while it renders"); + // A placed document of a test running beside this one moves the process-wide generation in + // the key: that makes a new frame, not this one again. + assert!(jobs.try_iter().all(|j| j.key.placed != job.key.placed), "not queued again while it renders"); assert!(app.canvas.texture.is_none()); done_tx.send(finished(&job)).unwrap();