[GH-ISSUE #4854] Flaky test: chunk_io::tests::failures_keep_the_newest_chunk_of_each_kind races with save.rs tests #1473

Closed
opened 2026-11-02 15:47:12 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ludovic111 on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4854

Originally assigned to: @navinor on GitHub.

🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself.

chunk_io keeps its pending failures in process-global state. failures_keep_the_newest_chunk_of_each_kind calls take(), reports three failures, then asserts take() equals exactly those. Tests in save.rs that make chunk writes fail (e.g. failed_async_writes_are_readable_and_never_reported_durable) call report_save_failure from their writer threads at the same time, so the assertion at crates/horizon-client/src/chunk_io.rs:114 sees another test's chunk.

Seen on #4835's verify (run 41150607729, unrelated change): assertion left == right failed, 882 passed, 1 failed.

Fix idea: a #[cfg(test)] mutex in chunk_io held by this test and by the save tests that produce failures, or make the pending state injectable (per-Game/per-saver sink) so tests don't share it.

Originally created by @ludovic111 on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4854 Originally assigned to: @navinor on GitHub. > 🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself. `chunk_io` keeps its pending failures in process-global state. `failures_keep_the_newest_chunk_of_each_kind` calls `take()`, reports three failures, then asserts `take()` equals exactly those. Tests in `save.rs` that make chunk writes fail (e.g. `failed_async_writes_are_readable_and_never_reported_durable`) call `report_save_failure` from their writer threads at the same time, so the assertion at `crates/horizon-client/src/chunk_io.rs:114` sees another test's chunk. Seen on #4835's verify (run 41150607729, unrelated change): `assertion left == right failed`, 882 passed, 1 failed. Fix idea: a `#[cfg(test)]` mutex in `chunk_io` held by this test and by the save tests that produce failures, or make the pending state injectable (per-`Game`/per-saver sink) so tests don't share it.
Author
Owner

@navinor commented on GitHub (Oct 31, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6539282023 --> @navinor commented on GitHub (Oct 31, 2026): 🤖 Agent: /claim
Sign in to join this conversation.
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
horizon-rust/horizon#1473
No description provided.