Repository navigation
Conversation
… of a written script Executing a script the test had just written could fail with "text file busy" when a concurrent fork in the test process inherited the write descriptor. The launcher is now /bin/sh -c 'exec /bin/sleep 300', and the test waits until the launcher has become the program instead of sleeping a fixed 200 ms. Closes #98 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A1xMi7WMQKm61tTfRrDhon Signed-off-by: Claude <noreply@anthropic.com>
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.
What and why
Closes #98.
TestARestartedBackendStopsAProcessItsLauncherExecedIntoflaked once in CI with "text file busy" when executing its launcher. The test wrote a launcher script and executed it right away. A concurrent fork in the same test process could still hold the inherited write descriptor (the classic Linux ETXTBSY race). The launcher is now the system shell (/bin/sh -c 'exec /bin/sleep 300', through the package's existingshell()helper), so no file is written and then executed. The test also pollspsuntil the launcher has become/bin/sleepbefore it restarts the backend, instead of sleeping a fixed 200 ms. The exec path is therefore proven rather than assumed.The property under test is unchanged: identity is the process start time, which
execvedoes not change, while the command line changes from the shell to/bin/sleep 300.How it was tested
go test ./adapters/deploy/local/ -race -count=20: ok (116 s), which is the issue's DoD.make check(build, e2e/smoke vet,golangci-lint run0 issues,go test ./... -race): rc=0 on head2bb55480, Linux.Checklist
make checkpasses locally (what CI runs: build,gofmt, thee2eandsmokesuites vetted, lint,go test ./... -race).make generatewas run andapi/is committed. (n/a)TestADRSetIsCompletewas updated. (n/a)pkg/changes are additive. (nopkg/change)git commit -s).Governance
make e2e(needs Docker); say where it ran.Quyết định của routine
/bin/sh -c. Chọn (c). Rename giữ nguyên inode nên không loại bỏ được descriptor bị kế thừa. Retry chỉ che race đi. Còn (c) xoá hẳn nguyên nhân và vẫn chứng minh đúng hành vi của test.shell()có sẵn và thay sleep cố định 200 ms bằng vòng chờ đến khi exec xảy ra.AGENTS.mdcủa repo quy định "Never push tomain. Branch, open a PR; the Owner merges". Quy định của repo được ưu tiên hơn quy tắc tự merge của routine.tests/smokevàcmd/supervisor/local_programs_test.gocũng ghi script 0o700 rồi chạy. Nếu chúng chạy song song thì có thể gặp cùng race này, nên tách thành issue riêng nếu tái diễn.Generated by Claude Code