Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

Modifed Test to run on Flaky Cl Test

Combiler0135521937031f
diff --git a/crates/ui-egui/tests/control.rs b/crates/ui-egui/tests/control.rs
index 9082c689c..baa3a6c26 100644
--- a/crates/ui-egui/tests/control.rs
+++ b/crates/ui-egui/tests/control.rs
@@ -1668,14 +1668,16 @@ fn control_open_replies_pending_while_the_worker_opens_and_focuses_once_it_has()
// The worker completes the open on later frames; the tab shows, and only then does a
// repeated open focus it instead of reporting another pending open.
+ // Background preparation can take fractions of a second on loaded CI runners (e.g. FreeBSD VM).
let mut documents = 0;
- for _ in 0..30 {
+ for _ in 0..300 {
h.run_steps(1);
let state = ok(&mut h, &c, "ui.state", json!({}));
documents = state["documents"].as_array().map(|d| d.len()).unwrap_or_default();
if documents == 1 {
break;
}
+ std::thread::sleep(std::time::Duration::from_millis(5));
}
assert_eq!(documents, 1, "the pending open completed into a tab");