Retry the raw-copy watch test when another test remaps (#354) #443

Closed
Kal0s-design wants to merge 1 commit from upstream-pr/443 into review/local-integration-20261129
Kal0s-design commented 2026-11-29 13:29:02 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Kal0s-design on 2026-11-29T13:29:02Z.


Targets #439's branch. Refs #354.

Even with #393's stale-VIEWS fix in, host::refresh_tests::raw_title_copy_keeps_write_watch_and_resends_equal_bytes still fails under parallel load. Four processes each ran host::refresh_tests watch:: --test-threads=8 25 times on cfd5ebd: 9 of 100 runs failed, all at after.expect("the copy preserves the query").

Cause: after a raw copy, Journal::covers keeps the query only while ahead_mapping == changes(), and changes() is global. Other fixtures (title(), the watch tests) remap unrelated title pages at any moment, so a remap anywhere in that window ends the query. That's the runtime being conservative, which is fine. The test just assumed nothing else remaps.

Fix (test only): note changes() before the round. If asked() comes back None and changes() moved, run the round again, up to 100 times. If the mapping didn't move, the old assertions apply unchanged, so a real loss of the query still fails.

Same stress after the change: 0 of 100 for this test. A temporary counter showed 9 runs needing a second try (5 needed 2 attempts, 2 needed 3, one 4, one 5). That matches the 9 failures before, which supports the cause.

One unrelated flake showed up in those 100 runs: watch::many_askers_tests::no_mapping_is_lost_between_askers. Correction: I first wrote that it failed at "the bits answered none". It didn't. It fails at the final assert!(super::published(at, end)), about once in 250 to 300 stressed runs. The cause is in a separate PR (see the comment below).

cargo test -p victory-gpu --lib raw_title_copy passes. Clippy on this branch shows only the errors #442 fixes.

AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5551178672 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/443). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-29T13:29:02Z. --- Targets #439's branch. Refs #354. Even with #393's stale-VIEWS fix in, `host::refresh_tests::raw_title_copy_keeps_write_watch_and_resends_equal_bytes` still fails under parallel load. Four processes each ran `host::refresh_tests watch:: --test-threads=8` 25 times on cfd5ebd: **9 of 100 runs failed**, all at `after.expect("the copy preserves the query")`. Cause: after a raw copy, `Journal::covers` keeps the query only while `ahead_mapping == changes()`, and `changes()` is global. Other fixtures (`title()`, the watch tests) remap unrelated title pages at any moment, so a remap anywhere in that window ends the query. That's the runtime being conservative, which is fine. The test just assumed nothing else remaps. Fix (test only): note `changes()` before the round. If `asked()` comes back `None` *and* `changes()` moved, run the round again, up to 100 times. If the mapping didn't move, the old assertions apply unchanged, so a real loss of the query still fails. Same stress after the change: **0 of 100** for this test. A temporary counter showed 9 runs needing a second try (5 needed 2 attempts, 2 needed 3, one 4, one 5). That matches the 9 failures before, which supports the cause. One unrelated flake showed up in those 100 runs: `watch::many_askers_tests::no_mapping_is_lost_between_askers`. **Correction:** I first wrote that it failed at "the bits answered none". It didn't. It fails at the final `assert!(super::published(at, end))`, about once in 250 to 300 stressed runs. The cause is in a separate PR (see the comment below). `cargo test -p victory-gpu --lib raw_title_copy` passes. Clippy on this branch shows only the errors #442 fixes. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
TaynanGT commented 2026-11-29 14:39:03 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T14:39:03Z.


I integrated this locally as 349e595d7 with your authorship preserved. All three targeted raw_title_copy tests passed on Windows. Thanks for keeping the retry bounded and leaving the unchanged-mapping assertion intact. I have not yet reproduced your 100-run stress matrix on the consolidated tree.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7257468379 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/443#issuecomment-7257468379). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T14:39:03Z. --- I integrated this locally as 349e595d7 with your authorship preserved. All three targeted raw_title_copy tests passed on Windows. Thanks for keeping the retry bounded and leaving the unchanged-mapping assertion intact. I have not yet reproduced your 100-run stress matrix on the consolidated tree.
Kal0s-design commented 2026-11-29 16:45:27 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Kal0s-design on 2026-11-29T16:45:27Z.


The askers flake mentioned above has its own PR now: #449. It was the final published assertion, not "the bits answered none". The PR text here is corrected.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7259153174 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/443#issuecomment-7259153174). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-29T16:45:27Z. --- The askers flake mentioned above has its own PR now: #449. It was the final `published` assertion, not "the bits answered none". The PR text here is corrected.
TaynanGT commented 2026-11-29 19:02:08 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T19:02:08Z.


Thanks for the correction and the separate #449. Keeping the final published assertion distinct from the raw-copy retry is important. I'll evaluate that fixture fix separately rather than broaden this PR.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7260953881 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/443#issuecomment-7260953881). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T19:02:08Z. --- Thanks for the correction and the separate #449. Keeping the final published assertion distinct from the raw-copy retry is important. I'll evaluate that fixture fix separately rather than broaden this PR.
TaynanGT commented 2026-11-30 17:06:37 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:06:37Z.


main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285733397 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/443#issuecomment-7285733397). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:06:37Z. --- `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
TaynanGT/Vice-Tay!443
No description provided.