From f9bfa19e74e7009fe224eebdbce3b15f8aff9589 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Wed, 18 Nov 2026 21:26:45 +0100 Subject: [PATCH] test: keep startup password assertions independent of worker order --- crates/ui-egui/tests/it/editing.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/tests/it/editing.rs b/crates/ui-egui/tests/it/editing.rs index 1a9d9cc14b..729259faad 100644 --- a/crates/ui-egui/tests/it/editing.rs +++ b/crates/ui-egui/tests/it/editing.rs @@ -2756,10 +2756,15 @@ fn a_startup_file_after_a_protected_one_keeps_its_password_prompt() { if unlock { h.state_mut().submit_password(Some("reader".into())); support::wait_until(&mut h, "both files", |app| app.views.len() == 2); - // The other file opened while the password was being typed; the unlocked one comes - // after it and is the one in view. - assert_eq!(open_paths(h.state()), vec![other_path, locked_path]); + // The password retry has worker priority, so either file can finish first. + // Both must open exactly once; the last admitted tab is the active one. + let mut paths = open_paths(h.state()); + paths.sort(); + let mut expected = vec![other_path, locked_path]; + expected.sort(); + assert_eq!(paths, expected); assert_eq!(h.state().active_ids().map(|(i, _)| i), Some(1)); + assert!(h.state().password_prompt.is_none(), "successful unlock leaves no stale prompt"); } else { h.state_mut().submit_password(None); support::wait_until(&mut h, "the other file", |app| app.views.len() == 1);