From 4818b462b71260ba74674d43e59d95c6b71df17a Mon Sep 17 00:00:00 2001 From: Don Omondi <282319807+mockydevs@users.noreply.github.com> Date: Wed, 4 Nov 2026 20:54:46 -0500 Subject: [PATCH] =?UTF-8?q?Tests:=20the=20Type=20=E2=80=BA=20Font=20menu?= =?UTF-8?q?=20test=20waits=20for=20the=20installed=20fonts'=20scan=20(#564?= =?UTF-8?q?7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit type_font_menu_lists_every_available_family read Type › Font while the scan the app starts could still be running. The scan bumps the font generation a moment before it counts as done, so a read in that gap lists only the loaded fonts under the new generation, and the test's "generation held still" check let the comparison with the full list fail. The test now waits for the scan after making the app, as the native menu tests do since #5653. --- crates/ui-egui/src/tests/fonts.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/tests/fonts.rs b/crates/ui-egui/src/tests/fonts.rs index f8f019171..073be1e08 100644 --- a/crates/ui-egui/src/tests/fonts.rs +++ b/crates/ui-egui/src/tests/fonts.rs @@ -9,6 +9,10 @@ use crate::{VectorcraftApp, menus}; #[test] fn type_font_menu_lists_every_available_family() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); + // The app starts the installed fonts' scan, and until it ends Type › Font lists only the + // loaded fonts (#5483). The scan changes the generation a moment before it counts as done, so + // a read in between sees the old list under the new generation: wait for it to end first. + FontDb::global().family_list(); app.run("file.new", json!({})).unwrap(); let fonts = |app: &VectorcraftApp| -> Vec { menus::menu_entries(app).into_iter().filter(|e| e.path == ["Type", "Font"]).map(|e| e.label).collect()