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 <noreply@anthropic.com>
This commit is contained in:
austin62jake
2026-10-29 07:37:20 +00:00
committed by GitHub
parent aee57875f5
commit c10d36a0b5
+4 -4
View File
@@ -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());