From ea904591a59d01c9af75c2e7ef5730227da3e3a3 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Wed, 14 Oct 2026 16:33:37 -0400 Subject: [PATCH] Fix flaky test: the missing-Recent test waits for the background open (#291 after #488) Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index e1f29e7d..f020f5f5 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -2809,6 +2809,15 @@ mod tests { // drawn message is a second node that mentions the name (the OS text after it varies). harness.get_by_label("missing.deckcraft").click(); harness.run_steps(2); + // The file is read in the background (#350): wait for that read to finish. + for _ in 0..500 { + if harness.state().opening.is_none() { + break; + } + std::thread::sleep(std::time::Duration::from_millis(10)); + harness.run_steps(1); + } + harness.run_steps(2); assert!(harness.state().toast.is_some(), "the open error was raised"); assert!(harness.get_all_by_label_contains("missing.deckcraft").count() >= 2, "the open error is drawn on the page, next to the entry"); }