test(crash): say what the Notes folder holds when the note's file cannot be read (#955) #972

Closed
kayg wants to merge 0 commits from flaky/nc-diag into dev
Owner

Refs #955. Diagnostics only; the flake is not fixed because it does not reproduce.

kill_nine_mid_append_on_a_long_note once read a note's file after seeing it exist and got NotFound. I could not reproduce it: 15 runs of the whole notes_crash binary, then 10 rounds of 4 copies side by side, then 15 rounds of 6 copies with a cargo build in another slot (dev-01, dev 789fdaa9): about 145 passes, 0 failures. The save path writes through atomic exchanges (fsio/src/swap.rs) and held::adopt reuses the file's identity, so reading the code shows no window where the file is missing. I did not make the test follow the server's current path or retry, because that could hide a real persistence defect (what the issue warns about).

What changes: the three file reads go through file_text, which on a failed read panics with the Notes folder's listing. The next occurrence then shows whether the file was renamed, moved or removed. No retry, no wait.

Gates (dev-01, through Nix and ~/bin/slot): cargo fmt --check -p calternal, cargo clippy -p calternal --tests -- -D warnings, cargo test -p calternal --test notes_crash (3 passed).

🤖 Generated with Claude Code

Refs #955. **Diagnostics only; the flake is not fixed because it does not reproduce.** `kill_nine_mid_append_on_a_long_note` once read a note's file after seeing it exist and got `NotFound`. I could not reproduce it: 15 runs of the whole `notes_crash` binary, then 10 rounds of 4 copies side by side, then 15 rounds of 6 copies with a cargo build in another slot (dev-01, dev `789fdaa9`): about 145 passes, 0 failures. The save path writes through atomic exchanges (`fsio/src/swap.rs`) and `held::adopt` reuses the file's identity, so reading the code shows no window where the file is missing. I did not make the test follow the server's current path or retry, because that could hide a real persistence defect (what the issue warns about). What changes: the three file reads go through `file_text`, which on a failed read panics with the Notes folder's listing. The next occurrence then shows whether the file was renamed, moved or removed. No retry, no wait. Gates (dev-01, through Nix and `~/bin/slot`): `cargo fmt --check -p calternal`, `cargo clippy -p calternal --tests -- -D warnings`, `cargo test -p calternal --test notes_crash` (3 passed). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kill_nine_mid_append_on_a_long_note read the file after seeing it exist and once got NotFound (#955). The three reads now go through file_text, which on a failed read panics with the folder's listing, so the next occurrence shows whether the file was renamed, moved or removed. Nothing is retried and no wait is added.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
style: cargo fmt
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
4ec3633faf
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Author
Owner

#972 gates: GREEN at 4ec3633f (Rust test diagnostic only)

On dev-01 through ~/bin/slot: cargo fmt --all --check rc 0; cargo clippy -j4 -p calternal --all-targets --locked -- -D warnings rc 0; cargo test -j4 -p calternal --test notes_crash --locked: 3 passed, 0 failed (kill_nine_mid_append_on_a_long_note, kill_nine_mid_tag_rename_renames_each_tag_once, kill_nine_never_loses_or_doubles). No production code in the diff (only crates/calternal/tests/notes_crash.rs), so no perf run.

## #972 gates: GREEN at `4ec3633f` (Rust test diagnostic only) On dev-01 through `~/bin/slot`: `cargo fmt --all --check` rc 0; `cargo clippy -j4 -p calternal --all-targets --locked -- -D warnings` rc 0; `cargo test -j4 -p calternal --test notes_crash --locked`: 3 passed, 0 failed (`kill_nine_mid_append_on_a_long_note`, `kill_nine_mid_tag_rename_renames_each_tag_once`, `kill_nine_never_loses_or_doubles`). No production code in the diff (only `crates/calternal/tests/notes_crash.rs`), so no perf run.
Author
Owner

Merged into dev by the orchestrator (U1 GREEN).

Merged into dev by the orchestrator (U1 GREEN).
kayg closed this pull request 2026-11-06 03:28:49 +00:00
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!972
No description provided.