Repository navigation
test(eval): avoid writing executable runtimes during parallel tests - #4527
Merged
Merged
Conversation
Create the shared shell fixture before the parent parallel barrier and use per-case symlinks and data files. Preserve digest pinning and fallback assertions without concurrent writes to executable fixture inodes. Signed-off-by: Arnaud Héritier <aheritier@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test-only change preserves existing coverage while addressing the demonstrated race condition.
Review effort: Balanced
Findings: None
What changed in this PR
Stabilizes the parallel evaluation image tests by sharing a prewritten runtime fixture.
Changes:
- Creates the executable fixture before parallel execution.
- Uses per-test symlinks and non-executable response files.
| File | Description |
|---|---|
pkg/evaluation/build_test.go |
Prevents concurrent executable writes that caused ETXTBSY failures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
trungutt
approved these changes
Oct 6, 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.
Fixes #4520
Change
Write one immutable shell runtime fixture before the parent
t.Parallel()barrier. Each parallel case symlinks that executable and writes only non-executable response/exit-marker files. This is test-only: the existing 12-case table, every assertion and both levels of parallelism remain unchanged. No production changes, retries, sleeps or relaxed assertions.Diagnosis
The original parallel cases write executable scripts immediately before executing them. Natural reproduction surfaces Linux
ETXTBSY(text file busy). An inspect execution error takes the intentional production fallback, leavinginspect-argsabsent and sometimes the Dockerfile's COPY unpinned; build execution errors expose the errno directly. The recovered CI log includes bothno_manifest_digestanddefault_imagefailures.A concurrent fork temporarily inheriting a sibling executable's writer descriptor is a plausible explanation, not syscall-proven. Prior diagnostic logging exposed inspect ETXTBSY; strace changed scheduling and did not reproduce it. The fix removes concurrent writes to the executed fixture inode.
Validation
Prior investigation (separate runs, not fresh PR-arc measurements):
6bf7273928569802Fresh PR-arc validation on main
285698023342389523089b3a36171eb88fb8dc40:go test -json -race -shuffle=1791198938208945572 -count=100 -run '^TestBuildEvalImagePinsLocalAgentDigest$' ./pkg/evaluation-race -shuffle=on -count=1001791278474244450004-race -shuffle=1791198938208945572 -count=3task build,task test,task lintCGO_ENABLED=1 task test-raceFocused commands source
.env.testand setCGO_ENABLED=1. Local Go1.27.0/Linux Ubuntu26.04 differs from CI Ubuntu24.04.5; Windows remains skipped, macOS untested. PR CI runs race tests only on main pushes, so these are local race results, not PR-CI results. Finite passes are not a suite-wide flake-freedom claim.Other observed flakes (not changed)
task testfirst failed the unrelatedpkg/cache/TestFileCache_dedupSkipsRedundantWritemodtime assertion, then passed on retry. Fresh unpatched cache control failed 17/20 repeats; this PR's fresh fulltask testpassed first time. Cache source is unchanged.1791278540484914705) failed once in unchangedTestEvalContainerForwardsOrderedFlavors/#00,flavors_test.go:37, executing its own per-case script:fork/exec .../runtime: text file busy. That fixture has the same parallel write-then-exec pattern. Target digest test passed all three repetitions. Clean unpatched-main controls did not reproduce the sibling failure (100 focused race runs, 10 same-seed package race runs); candidate same-seed package/count3 rerun and subsequent full race suite passed. The sibling's frequency and pre-existing attribution are not established by these samples. Left outside this one-test fix.