Repository navigation
tarcmd tests: the passthrough filter is written once, before any child - #69
Merged
Merged
Conversation
TestCompressProgram wrote its filter script and ran it through tar's -I in the same test, in parallel with tests that run zstdmt, unzstd and the system tar. A child forked by one of those between the script's open and close inherits the write descriptor until its exec, and running the script in that window fails with "text file busy" (golang/go#22315); the verify lane met it on ubuntu-24.04-arm and passed on a rerun. TestMain now writes the script before any test runs, with no child alive, and the test runs it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: closer-claudio <claudio@farcloser.world>
closer-claudio
enabled auto-merge
November 10, 2026 05:46
Contributor
Author
|
Reviewed at f78b159 |
apostasie
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Why
TestCompressProgramfailed once on #67 verify lane, ubuntu-24.04-arm (https://github.com/forkcloser/compress/actions/runs/42761685321/job/129648982339):tar: …/passthrough: Cannot run: text file busy, then passed on a rerun. The test wrote its filter script and ran it through-Iwhile parallel tests in the package forkzstdmt,unzstdand the system tar.forkcopies every descriptor, close-on-exec ones included, and a child between fork and exec holds the script's write descriptor until its exec; the kernel refuses to exec a file open for writing (golang/go#22315,os/execdoes not retry).🛠️ What
internal/tarcmd/run_test.go: aTestMainwrites the passthrough script once, beforem.Run, into a temporary directory removed afterwards;TestCompressProgramruns that script and writes nothing executable. The window is closed by construction: the script's write descriptor is closed before the test process forks for the first time, so no child can inherit it.🧪 How
V: the tarcmd package and
just test(273 tests) green,just lintgreen. V: Go's test wrapper passesm.Run's result toos.ExitwhenTestMainreturns (testing.go), so no explicit exit. U: the race is not reproducible on demand; the argument is structural.