Repository navigation
Conversation
The fake cloudflared executable could fail with ETXTBSY when a writable handle to its executable inode remained open. Execute a checked-in immutable entrypoint and keep each test's script body in a separate data file, with a regression that holds writers open while invoking the fixture.
yyjeqhc
approved these changes
Oct 28, 2026
yyjeqhc
left a comment
Owner
There was a problem hiding this comment.
Reviewed the scoped implementation and regression coverage against its source baseline; CI and diff checks pass. No blocking issue identified.
This was referenced Oct 28, 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.
Problem
The
fake_cloudflaredtest fixture wrote each test's shell script directly to the executable path and executed it. When any process still held a writable handle to that inode (for example a concurrent test fork inheriting the descriptor, or the writing test itself),execfailed withETXTBSY(ExecutableFileBusy). This is a fixture/stability problem, not a production cloudflared behavior change.Change
The fixture now executes a checked-in, immutable entrypoint (
tests/fixtures/cloudflared.sh) through a symlink and keeps each test's script body in a siblingcloudflared.scriptdata file that the entrypoint sources. Writable handles can only ever target the data file, never the executable inode.$0-relative paths keep working, including the existing<path>.descendant-pidand<path>.scriptconventions, and quoting keeps them correct in directories containing spaces.Test-only: no production code, no real Cloudflare access, no credentials, no services are started.
Validation
The regression keeps writable handles open on every regular file in the fixture directory while invoking the fake binary, then asserts the expected stdout and exit status.
Platform:
#[cfg(unix)], matching the existing fixture. Not run here: Windows and macOS lanes (no environment available).