[PR #5034] [MERGED] Keep the chunk_io tests off the queue the save tests also fill #6017

Closed
opened 2026-11-03 05:16:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5034
Author: @navinor
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/chunk-io-test-race


📝 Commits (1)

  • 3d9e3db Keep the chunk_io tests off the queue the save tests also fill

📊 Changes

1 file changed (+43 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/chunk_io.rs (+43 -16)

📄 Description

🤖 Opened by navinor's AI agent (OpenCode, Claude Opus 5.5), not by navinor personally.

What and why

Fixes #4854: the chunk_io tests fail now and then when the whole lib test suite runs.

chunk_io::PENDING is one process-wide queue. The chunk_io tests reset it with take(), report failures, then compare what they take back. Meanwhile save tests in the same process (save::failed_async_writes_are_readable_and_never_reported_durable and the others that fail a region read or write) call report_load_failure / report_save_failure from their own threads, so a save failure can land between a test's reports and its take().

This PR keeps the tests off the shared queue instead of serialising every test that can fail a chunk:

  • The newest-chunk rules move into Pending::load_failed and Pending::save_failed. report_load_failure and report_save_failure call them under the same lock as before, so the window still sees the same toasts.
  • warn_on_low_disk_space returns what it found, and the flag is set together with the chunk under one lock (before, they were two lock acquisitions).
  • failures_keep_the_newest_chunk_of_each_kind now runs on a local Pending, and also checks that a later failure on a full disk raises the low-space flag and that one with space left does not clear it.
  • a_servers_warning_packet_toasts_low_disk_space is the only test left on PENDING. Nothing in the lib clears the flag (the two other take() callers, game/dedicated.rs and game/server_packs.rs, are in the bin, whose tests run in another process), so the flag it raises is still there when it takes it.
  • The old assertion that a missing folder gives no low-space warning is dropped: on Windows, fs4 resolves a missing path to its drive and reads the drive's real free space, so it held only on Linux. save::tests::low_disk_space_is_under_64_mib_usable already covers that case on Unix.

Kind

  • tooling: tools, CI, tests, harnesses

Vanilla reference

None: the toasts' behaviour (IntegratedServer.reportChunkLoadFailure / reportChunkSaveFailure, MinecraftServer.warnOnLowDiskSpace) is unchanged; this only moves the rules where a test can reach them without the shared queue.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on Aaron, against origin/main at 9d979caa4, 7 min 26 s)

Check Result
Scope ✅ 1 files, +43 −16
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 495 passed (52 s)
rustfmt ✅ (7 s)
clippy ✅ (59 s)
tests: horizon-client ✅ 1330 passed (5 min 22 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with OpenCode


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5034 **Author:** [@navinor](https://github.com/navinor) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/chunk-io-test-race` --- ### 📝 Commits (1) - [`3d9e3db`](https://github.com/horizon-rust/horizon/commit/3d9e3dbe6eed1cd561cb73f5c0e2287c138f7ee0) Keep the chunk_io tests off the queue the save tests also fill ### 📊 Changes **1 file changed** (+43 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/chunk_io.rs` (+43 -16) </details> ### 📄 Description > 🤖 Opened by navinor's AI agent (OpenCode, Claude Opus 5.5), not by navinor personally. ## What and why Fixes #4854: the `chunk_io` tests fail now and then when the whole lib test suite runs. `chunk_io::PENDING` is one process-wide queue. The `chunk_io` tests reset it with `take()`, report failures, then compare what they take back. Meanwhile save tests in the same process (`save::failed_async_writes_are_readable_and_never_reported_durable` and the others that fail a region read or write) call `report_load_failure` / `report_save_failure` from their own threads, so a save failure can land between a test's reports and its `take()`. This PR keeps the tests off the shared queue instead of serialising every test that can fail a chunk: - The newest-chunk rules move into `Pending::load_failed` and `Pending::save_failed`. `report_load_failure` and `report_save_failure` call them under the same lock as before, so the window still sees the same toasts. - `warn_on_low_disk_space` returns what it found, and the flag is set together with the chunk under one lock (before, they were two lock acquisitions). - `failures_keep_the_newest_chunk_of_each_kind` now runs on a local `Pending`, and also checks that a later failure on a full disk raises the low-space flag and that one with space left does not clear it. - `a_servers_warning_packet_toasts_low_disk_space` is the only test left on `PENDING`. Nothing in the lib clears the flag (the two other `take()` callers, `game/dedicated.rs` and `game/server_packs.rs`, are in the bin, whose tests run in another process), so the flag it raises is still there when it takes it. - The old assertion that a missing folder gives no low-space warning is dropped: on Windows, fs4 resolves a missing path to its drive and reads the drive's real free space, so it held only on Linux. `save::tests::low_disk_space_is_under_64_mib_usable` already covers that case on Unix. ## Kind - [x] tooling: tools, CI, tests, harnesses ## Vanilla reference None: the toasts' behaviour (`IntegratedServer.reportChunkLoadFailure` / `reportChunkSaveFailure`, `MinecraftServer.warnOnLowDiskSpace`) is unchanged; this only moves the rules where a test can reach them without the shared queue. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Aaron, against origin/main at 9d979caa4, 7 min 26 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +43 −16 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 495 passed (52 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (59 s) | | tests: horizon-client | ✅ 1330 passed (5 min 22 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [OpenCode](https://opencode.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:16:39 +07:00
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#6017
No description provided.