From 8482c3e85bc5f2a430e2f3be2826674872f6d084 Mon Sep 17 00:00:00 2001 From: Andrey <38911974+Barzabel@users.noreply.github.com> Date: Thu, 15 Oct 2026 06:53:18 +0300 Subject: [PATCH] M7: home tests wait for the recent files reader instead of a fixed frame count (#351) (#354) --- crates/ui-egui/src/home_tests.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/home_tests.rs b/crates/ui-egui/src/home_tests.rs index 1179b1c4..f2091f01 100644 --- a/crates/ui-egui/src/home_tests.rs +++ b/crates/ui-egui/src/home_tests.rs @@ -22,11 +22,22 @@ fn shapes(u: &mut Ui) -> Vec { flat(&u.frame_output(vec![]).shapes) } -/// Enough frames for every thumbnail in view (they render one a frame) and what follows a click. +/// Enough frames for every thumbnail in view (they render one a frame) and what follows a click, +/// then until every recent file has been looked at: the reader is a thread of its own, and until it +/// answers a file's card is a skeleton without its name (on a loaded machine, 12 frames weren't +/// always enough, #351). fn settle(u: &mut Ui) -> Vec { for _ in 0..12 { u.frame(vec![]); } + for _ in 0..400 { + let files = u.app.inspect()["homeRecents"]["files"].as_array().cloned().unwrap_or_default(); + if files.iter().all(|f| !f["exists"].is_null()) { + break; + } + std::thread::sleep(std::time::Duration::from_millis(5)); + u.frame(vec![]); + } shapes(u) }