fix: prevent parallel Ginkgo processes from racing on func CLI download#135
Merged
creydr merged 2 commits intoMay 11, 2026
Merged
Conversation
When e2e tests run with ginkgo -p, multiple OS processes can simultaneously detect that the func CLI binary is missing and attempt to download it concurrently. This causes flaky failures from corrupted binaries or missing temp files. Fix by using syscall.Flock for cross-process file locking with double-checked locking, and writing to a temp file with atomic rename so partially-written binaries are never visible.
0aebb47 to
6e5fbf3
Compare
Collaborator
Author
|
/cherry-pick release-0.2 |
|
Only merged pull requests can be cherry-picked. |
|
Cherry-pick failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-0.2
git worktree add -d .worktree/cherry-pick-135-to-release-0.2 origin/release-0.2
cd .worktree/cherry-pick-135-to-release-0.2
git switch --create cherry-pick-135-to-release-0.2
git cherry-pick -x 45c44ab2eac4894f4b9a7c8d4850503f2b7b5d0d |
Collaborator
Author
|
/cherry-pick release-0.3 |
|
Successfully created cherry-pick PR for |
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.
Summary
syscall.Flockcross-process file locking with double-checked locking pattern toensureFuncVersiondownloadFuncVersionso partially-written binaries are never visibleRoot cause
With
ginkgo -p, tests run in 4 separate OS processes. Multiple processes can simultaneously detect the binary is missing and callos.Createon the same file path, corrupting the binary. The old code (pre #132) failed at checksum verification; the current code would fail when trying to execute the corrupted binary.