[PR #2793] [MERGED] test: give each win_screen test its own temp dir #4618

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2793
Author: @ludovic111
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: test/win-screen-temp-dirs


📝 Commits (1)

  • f08a564 test: give each win_screen test its own temp dir

📊 Changes

1 file changed (+6 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/win_screen.rs (+6 -5)

📄 Description

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

Why

win_screen::tests::the_screen_ends_once_everything_rolled_past fails intermittently in cargo test -p horizon-client --lib with Os { code: 22, kind: InvalidInput } at the HudAtlas::fonts(&root).unwrap() line. It failed twice on the Mac mini today, in two unrelated pr_ready runs, and passes alone.

The test helper screen() named its temporary resource root horizon-win-screen-{pid}-{poem}-{end.len()}. Two tests call it with the same arguments (screen(false, "", CREDITS, "")), and libtest runs them in parallel, so they shared the directory: one test's remove_dir_all deleted the other's files while it was reading them.

What

A static counter in the helper gives each call its own directory (horizon-win-screen-{pid}-{n}). This changes the test only.

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 7262304a6, 7 min 58 s)

Check Result
Scope ✅ 1 files, +6 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 331 passed (31 s)
rustfmt ✅ (5 s)
clippy ✅ (2 min 12 s)
tests: horizon-client ✅ 1329 passed (3 min 38 s)
doc tests ✅ 0 passed (1 min 0 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 ➖ 31 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 19 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 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/2793 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `test/win-screen-temp-dirs` --- ### 📝 Commits (1) - [`f08a564`](https://github.com/horizon-rust/horizon/commit/f08a564fa60ab1722181c59aa226ecedc7f975cb) test: give each win_screen test its own temp dir ### 📊 Changes **1 file changed** (+6 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/win_screen.rs` (+6 -5) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## Why `win_screen::tests::the_screen_ends_once_everything_rolled_past` fails intermittently in `cargo test -p horizon-client --lib` with `Os { code: 22, kind: InvalidInput }` at the `HudAtlas::fonts(&root).unwrap()` line. It failed twice on the Mac mini today, in two unrelated pr_ready runs, and passes alone. The test helper `screen()` named its temporary resource root `horizon-win-screen-{pid}-{poem}-{end.len()}`. Two tests call it with the same arguments (`screen(false, "", CREDITS, "")`), and libtest runs them in parallel, so they shared the directory: one test's `remove_dir_all` deleted the other's files while it was reading them. ## What A static counter in the helper gives each call its own directory (`horizon-win-screen-{pid}-{n}`). This changes the test only. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 7262304a6, 7 min 58 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +6 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 331 passed (31 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (2 min 12 s) | | tests: horizon-client | ✅ 1329 passed (3 min 38 s) | | doc tests | ✅ 0 passed (1 min 0 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 | ➖ 31 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 19 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:06:42 +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#4618
No description provided.