Tests: the viewer find test waits for results by a deadline, not a frame count (#779)

Under a full workspace test run the background find could still be searching after 60 short
frames: 12 of 15 matches were in when the assertion ran. The PAGE re-run had the same race.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-15 03:00:20 -04:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 71ceafd467
commit 1bc064d84a
+5 -1
View File
@@ -128,7 +128,11 @@ fn view_history_select_all_and_find_options() {
assert_eq!(h.state().views[0].find.as_ref().unwrap().matches.len(), 0, "\"page\" alone, lower case, appears nowhere");
h.state_mut().views[0].find.as_mut().unwrap().query = "PAGE".into();
h.state_mut().views[0].rerun_find();
h.run_steps(2);
let deadline = std::time::Instant::now() + std::time::Duration::from_secs(20);
while std::time::Instant::now() < deadline && h.state().views[0].find.as_ref().unwrap().matches.len() < 5 {
h.run_steps(2);
std::thread::sleep(std::time::Duration::from_millis(5));
}
assert_eq!(h.state().views[0].find.as_ref().unwrap().matches.len(), 5);
}