diff --git a/CHANGELOG.md b/CHANGELOG.md index b416e0e2..4c81a50a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +* **Reliability pass on the tests** (M8). Twelve runs of the whole suite after the review's + fixes (the picture cache race and the split command fuzz) found no further flaky test. Tests + that wait for another thread (a save, a freed port, a GPU start) now give it a minute instead + of two seconds before failing on a busy machine; none of them asserts a time. + * **Reliability fixes from the November principal-engineer review** (M8, `docs/reviews/2026-11-principal-review.md`). * **Save is flushed to the disk** before the new file replaces the old one, as the diff --git a/crates/cli/src/control/tests.rs b/crates/cli/src/control/tests.rs index afc967f4..c073dbdd 100644 --- a/crates/cli/src/control/tests.rs +++ b/crates/cli/src/control/tests.rs @@ -328,7 +328,8 @@ fn dropping_the_server_frees_the_port() { let port = server.port; assert!(TcpListener::bind(("127.0.0.1", port)).is_err(), "the port is taken while the server lives"); drop(server); - let freed = (0..200).any(|_| { + // (Up to a minute: the listening thread ends when it next runs, late on a busy machine.) + let freed = (0..6000).any(|_| { std::thread::sleep(Duration::from_millis(10)); TcpListener::bind(("127.0.0.1", port)).is_ok() }); diff --git a/crates/render/src/stroke.rs b/crates/render/src/stroke.rs index 5b6c9c6e..f6407481 100644 --- a/crates/render/src/stroke.rs +++ b/crates/render/src/stroke.rs @@ -931,9 +931,9 @@ mod tests { assert!(apart < 1.0 / 255.0, "{what}, {how}: {apart}"); // 3. Against the truth: each pixel sampled 16 × 16 times against the pieces. // (Checked for the plain styles; a sample grid is good to a sixteenth.) - let (pieces, _) = piece_loops(&lines, hw, &outline, profile.as_ref(), None, false); - let before = coverage(&pieces, FillRule::NonZero); if how == "round" || how == "dashes whose round caps overlap" { + let (pieces, _) = piece_loops(&lines, hw, &outline, profile.as_ref(), None, false); + let before = coverage(&pieces, FillRule::NonZero); for y in (0..300).step_by(7) { for x in 0..400 { let c = drawn[y * 400 + x]; diff --git a/docs/roadmap.md b/docs/roadmap.md index 427deb4a..76deeb6e 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -34,7 +34,7 @@ an ADR. *Lane* names the part of the code an item mostly touches. Two items in * lanes** with no entry under *Needs* can be built and merged in parallel; two in the **same lane** are better done one after the other, because they meet in the same files. The ids are stable: an item keeps its id when the order changes, a new item takes the next free number -wherever it is placed (P-056 is in the first tier), and a finished item leaves the table for +wherever it is placed (P-056 was in the first tier), and a finished item leaves the table for the changelog. ## Backlog @@ -59,7 +59,6 @@ the changelog. | P-014 | Pen pressure on every desktop: Linux Wayland (outside PR [#320](https://github.com/storytold/anicraft/issues/320)), reports from tablets ([#290](https://github.com/storytold/anicraft/issues/290)) | Tools | M | a tablet to test with | platform | | P-015 | Verified by hand on real machines: the Mac checklist of [ADR 0062](adr/0062-test-movie-window-and-macos-document-opening.md), a hybrid-GPU laptop, passes with Narrator, VoiceOver and Orca ([ADR 0064](adr/0064-accessibility-second-pass.md)), launcher icons on Fedora ([#348](https://github.com/storytold/anicraft/issues/348)) | Accessibility, platforms | M | the machines; the person | platform | | P-016 | The guide tells the truth: "Coming from Animate" still lists shipped features as missing; close the issues the appendix marks delivered (the lead does that) | (docs) | S | | docs | -| P-056 | The test `a_document_that_is_not_shown_keeps_no_pictures` (`src/tabs_tests.rs`) passes every time: on `main` it fails about two runs in three on Windows, alone or in the full run, so a red `cargo test` says nothing | (robustness) | S | | shell | ### Next: the parity gaps artists meet every day diff --git a/src/gpu_stage.rs b/src/gpu_stage.rs index 74215b39..177d59e9 100644 --- a/src/gpu_stage.rs +++ b/src/gpu_stage.rs @@ -589,10 +589,11 @@ mod imp { ) } - /// Frames until the start thread has answered (bounded). + /// Frames until the start thread has answered (bounded: a minute, which only a start + /// thread that never answers reaches; a busy machine can take seconds to run it). fn settle(m: &mut Imp, svc: &RenderService, ctx: &egui::Context, now: f64, size: (u32, u32)) -> Vec { let mut out = Vec::new(); - for _ in 0..400 { + for _ in 0..12_000 { out.extend(m.sync(true, svc, ctx, now, size)); if m.starting.is_none() { break; diff --git a/src/remote.rs b/src/remote.rs index 83554d9a..f6c07b3d 100644 --- a/src/remote.rs +++ b/src/remote.rs @@ -193,7 +193,7 @@ mod tests { assert!(!file.exists(), "the token file goes when the window closes"); assert_eq!(super::port(&app), None); // The port is free again: the same run can open another window on it (ADR 0092). - let freed = (0..200).any(|_| { + let freed = (0..6000).any(|_| { std::thread::sleep(std::time::Duration::from_millis(10)); std::net::TcpListener::bind(("127.0.0.1", port)).is_ok() }); diff --git a/src/tabs_tests.rs b/src/tabs_tests.rs index e8c0d3ac..b997606d 100644 --- a/src/tabs_tests.rs +++ b/src/tabs_tests.rs @@ -415,8 +415,9 @@ fn autosave_and_recovery_cover_every_open_document() { let dir = std::env::temp_dir().join(format!("anicraft-tabs-recovery-{}", std::process::id())); let _ = std::fs::remove_dir_all(&dir); std::fs::create_dir_all(&dir).unwrap(); + // (A minute: a deadline for a save thread on a busy machine, not a time that is checked.) let wait = |saver_ids: &[String]| { - for _ in 0..200 { + for _ in 0..6000 { if saver_ids.iter().all(|id| recovery::document_path(&dir, id).exists()) { return; }