mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-24 10:37:03 -06:00
Tests: fix two flakes (recovery lock held by a forked mkfifo; notes check not in yet)
recovery::another_running_instance_keeps_its_entries unlocks the other instance's lock instead of only dropping it: a mkfifo child spawned by a parallel test shares the open file until it execs, keeping the flock held (seen on the FreeBSD VM). spelling_tests::notes_menu_language_dialog_and_repeated_words waits for the background notes check before right-clicking (seen on ubuntu CI). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
83f21e7cb9
commit
19724866a6
@@ -311,7 +311,10 @@ mod tests {
|
||||
let opened = open(&mut s2, &dir).unwrap();
|
||||
assert!(s2.documents().iter().all(|d| d.uid != uid), "{opened:?}");
|
||||
assert!(lock_path(&dir, other).exists(), "a live owner's lock stays");
|
||||
// Once the owner is gone, its entry is recovered and its lock file cleaned up.
|
||||
// Once the owner is gone, its entry is recovered and its lock file cleaned up. Unlock
|
||||
// rather than only drop: a child spawned meanwhile by a parallel test (mkfifo) shares the
|
||||
// open file and would keep the lock held until it execs.
|
||||
lock.unlock().unwrap();
|
||||
drop(lock);
|
||||
let mut s3 = Session::new();
|
||||
open(&mut s3, &dir).unwrap();
|
||||
|
||||
@@ -233,7 +233,9 @@ fn notes_menu_language_dialog_and_repeated_words() {
|
||||
if let (Ok(path), Ok(img)) = (std::env::var("DECKCRAFT_PNG_OUT_NOTES"), h.render()) {
|
||||
let _ = img.save(path);
|
||||
}
|
||||
// Right-click the notes' first word.
|
||||
// Right-click the notes' first word, once the (background) notes check is in.
|
||||
assert_eq!(h.state_mut().squiggles.settle_notes("Remmeber the the plan", "xx-NM"), vec![(0, 8), (13, 16)]);
|
||||
h.run_steps(2);
|
||||
let notes = h.query_all_by_role(Role::MultilineTextInput).next().map(|n| n.rect()).unwrap();
|
||||
right_click(&mut h, egui::pos2(notes.left() + 14.0, notes.top() + 8.0));
|
||||
if let (Ok(path), Ok(img)) = (std::env::var("DECKCRAFT_PNG_OUT_NOTES_MENU"), h.render()) {
|
||||
@@ -245,6 +247,7 @@ fn notes_menu_language_dialog_and_repeated_words() {
|
||||
let notes_text = |h: &Harness<'_, SlideApp>| h.state().session.active().unwrap().doc.slides[0].notes_text();
|
||||
assert_eq!(notes_text(&h), "Remember the the plan");
|
||||
// The repeated "the": its squiggle starts after "Remember the ".
|
||||
h.state_mut().squiggles.settle_notes("Remember the the plan", "xx-NM");
|
||||
h.run_steps(4);
|
||||
let x = h.query_all_by_role(Role::MultilineTextInput).next().map(|n| n.rect()).unwrap();
|
||||
let mut found = false;
|
||||
|
||||
Reference in New Issue
Block a user