Fix flaky test: the missing-Recent test waits for the background open (#291 after #488)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-14 16:33:37 -04:00
co-authored by Claude Opus 5.5
parent afe4a408b9
commit ea904591a5
+9
View File
@@ -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");
}