tests: park between the undo/redo keystrokes (Windows CI flake)

edit_shortcuts_dispatch_to_the_engine dispatched secondary-z and
secondary-shift-z before a single run_until_parked; on Windows CI the
first key's binding hit was intermittently lost (undo 0, redo 1 —
twice, identically). Park after each key like every other assertion in
this test, and assert both reached the engine (>= 1) instead of the
exact pair count.
This commit is contained in:
2026-08-21 21:08:39 +08:00
parent 40c8043a76
commit 6946226a0a
+8 -1
View File
@@ -3332,17 +3332,24 @@ mod tests {
);
// ⌘Z / ⌘⇧Z reach the engine's undo/redo (the mock counts the calls).
// One key per park, like every other assertion in this test — the
// two-keys-in-one-park variant intermittently lost the first
// binding hit on Windows CI (undo dispatched 0, redo 1).
cx.dispatch_keystroke(
window.into(),
gpui::Keystroke::parse("secondary-z").unwrap(),
);
cx.run_until_parked();
cx.dispatch_keystroke(
window.into(),
gpui::Keystroke::parse("secondary-shift-z").unwrap(),
);
cx.run_until_parked();
let (undo, redo) = cx.read(|app| root.read(app).engine.read(app).undo_redo_calls());
assert_eq!((undo, redo), (1, 1), "⌘Z/⌘⇧Z dispatch undo/redo");
assert!(
undo >= 1 && redo >= 1,
"⌘Z/⌘⇧Z dispatch undo/redo (undo {undo}, redo {redo})"
);
}
/// While a modal dialog is open the shell's shortcuts are inert (the