From c10d36a0b5fc937385031dcd8e9e9e9a7b27d96a Mon Sep 17 00:00:00 2001 From: austin62jake Date: Thu, 29 Oct 2026 07:37:20 +0000 Subject: [PATCH] Tests: Open Linked Design waits for the part as settle waits for a load (#8716) menu_tests::linked_component_opens_its_part_in_a_tab_and_reports_a_missing_source gave the background open of the linked part 600 frames. Headless frames are quick, so on a loaded machine (the whole ui-egui suite at once) the read can take longer, and the test then found the assembly still shown. It now waits until the part is open, up to 120 s as Harness::settle and the edit-in-place tests wait for a load. Co-authored-by: Claude --- crates/ui-egui/src/menu_tests.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/menu_tests.rs b/crates/ui-egui/src/menu_tests.rs index 81e12a0f8..49c517d0b 100644 --- a/crates/ui-egui/src/menu_tests.rs +++ b/crates/ui-egui/src/menu_tests.rs @@ -72,10 +72,10 @@ fn linked_component_opens_its_part_in_a_tab_and_reports_a_missing_source() { assert!(!context_menu::items(&h.app, &Target::Component { id: 0 }).iter().any(|item| item.label == "Open Linked Design")); act(&mut h.app, &linked, "Open Linked Design"); - for _ in 0..600 { - if h.app.session.path.as_deref() == part.to_str() { - break; - } + // The part opens in the background. A count of frames is no bound for that: frames are quick + // while a loaded machine is slow to read the file. Wait as `Harness::settle` waits for a load. + let began = std::time::Instant::now(); + while h.app.session.path.as_deref() != part.to_str() && began.elapsed() < std::time::Duration::from_secs(120) { h.frame(); } assert_eq!(h.app.session.path.as_deref(), part.to_str());