[PR #2803] [MERGED] test: retry ETXTBSY in horizon-server tests that run a script they just wrote #4625

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

📋 Pull Request Information

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

Base: main ← Head: test/server-check-text-busy


📝 Commits (1)

  • be0a932 test: retry ETXTBSY when horizon-server tests run a script they just wrote

📊 Changes

1 file changed (+33 additions, -9 deletions)

View changed files

📝 crates/horizon-server/src/engine.rs (+33 -9)

📄 Description

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

Why

The verify job of #2215 failed in horizon-server, in a test that change doesn't touch:

engine::tests::the_check_runs_the_program
  left: Err("the game (/tmp/horizon-server-check-13960/starts) can't start: Text file busy (os error 26)")

The test writes a shell script and runs it at once. If another test thread forks to spawn a process while the script's write handle is still open, the child inherits that handle and keeps it until it execs. Running the script in that window fails with ETXTBSY on Linux.

What

The two engine tests that write a script and then run it now retry that one error, up to 50 times at 20 ms intervals:

  • the_check_runs_the_program, through a small check_written helper;
  • a_relative_folder_reaches_the_game_whole, around its spawn.

Every other result is returned as before. Only the tests change.

Self-check

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 2b910fa16, 3 min 9 s)

Check Result
Scope ✅ 1 files, +33 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 331 passed (55 s)
rustfmt ✅ (9 s)
clippy ✅ (1 min 44 s)
tests: horizon-server ✅ 50 passed (16 s)
doc tests ➖ no library touched
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 ➖ 1 affected, to run in CI (--quick): lan_integration
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/2803 **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/server-check-text-busy` --- ### 📝 Commits (1) - [`be0a932`](https://github.com/horizon-rust/horizon/commit/be0a93271f18fe69b3a794b0b006b753a56156d7) test: retry ETXTBSY when horizon-server tests run a script they just wrote ### 📊 Changes **1 file changed** (+33 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-server/src/engine.rs` (+33 -9) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## Why The verify job of #2215 failed in `horizon-server`, in a test that change doesn't touch: ``` engine::tests::the_check_runs_the_program left: Err("the game (/tmp/horizon-server-check-13960/starts) can't start: Text file busy (os error 26)") ``` The test writes a shell script and runs it at once. If another test thread forks to spawn a process while the script's write handle is still open, the child inherits that handle and keeps it until it execs. Running the script in that window fails with ETXTBSY on Linux. ## What The two engine tests that write a script and then run it now retry that one error, up to 50 times at 20 ms intervals: - `the_check_runs_the_program`, through a small `check_written` helper; - `a_relative_folder_reaches_the_game_whole`, around its `spawn`. Every other result is returned as before. Only the tests change. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 2b910fa16, 3 min 9 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +33 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 331 passed (55 s) | | rustfmt | ✅ (9 s) | | clippy | ✅ (1 min 44 s) | | tests: horizon-server | ✅ 50 passed (16 s) | | doc tests | ➖ no library touched | | 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 | ➖ 1 affected, to run in CI (--quick): lan_integration | | 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:45 +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#4625
No description provided.