GRI-2088: fix ETXTBSY race in pptx_video fake_program test helper #221
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!221
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-2088-fake-program-etxtbsy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #220.
pptx_video::tests::fallback_returns_pages_in_page_orderfailed at random withFailed { tool: "soffice", detail: "Text file busy (os error 26)" }.Cause:
fake_programwrote the fake script withstd::fs::writein-process, then exec'd it. A concurrentfork()from another test thread could inherit our open write fd on that file; if ourexeclanded inside that window, Linux refused it withETXTBSY(O_CLOEXECdoes not close this window — rust-lang/rust#114554).Fix:
fake_programnow writes the script via a piped childsh -c 'cat > "$1" && chmod 755 "$1"'instead of writing in-process, so this process never holds a writable fd on the fake program for another fork to inherit. Removed the now-unusedPermissionsExtimport.Evidence: ran
pptx_video::tests200 times with--test-threads=16: 0 failures (previously intermittentETXTBSY).Local gates (
./scripts/local-gates.sh): all green (Rust gates, npm ci, frontend-web check/build).Reviewed: the fix is right. The writable fd now lives only in a child that has exited before the exec, so no fork can carry it. I merged dev (#219) into the branch so it is current; I merge when CI is green. After that, #217 needs dev merged once more.