Repository navigation
mutate: every test process held to its share of the memory - #20
Merged
Merged
Conversation
…it that passes it refused An edit that flips the only exit of a loop that appends allocates gigabytes a second, long before -test.timeout fires: on a CI runner it took the whole job, and the Gate, with it. Each test process and what it starts are measured from /proc and stopped past their share of the memory free when the run starts (-mem to set it), and the edit is reported refused, named with the bound. Fixes #19 Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Fixes #19.
An edit that flips the only exit of a loop that appends (spin#199's
Ancestors,== becomes !=) allocates gigabytes a second;-test.timeoutbounds time, not memory, and on the CI runner the whole job went, and the Gate with it.What changes
/procevery 100 ms for all watched processes (a scan is ~2 ms, so one per process would cost a fifth of a core at-j 10) and SIGKILLs the whole tree past its limit. The tree matters: undergo testthe test binary is the go command's child and does not die with it.Ask(the schema binary),Run(an edit built alone) andCover. Builds are not bounded.Exceededoutcome, counted with the refused:task mutate).-memflag in GiB. By default (0) each job getsMemAvailable / -j, so the jobs together cannot pass what was free when the run started; a negative value removes the bound.Sharetakes the memory beside the jobs (internal package).Tests (no network)
/proc/meminfoand/proc/<pid>/statparsers on fixed input, including a process name with parentheses and spaces.Share's memory share, a value given, and no bound.RunAll, checking the report line) and built alone: the package as it is passes under the same bound, compiler included; the edit isExceeded; and no test binary is left running. The fixture stops at 1 GiB and sleeps, so a broken bound fails the test instead of taking the machine. Checked to fail with the kill disabled, with only the root killed, and with the comparison inverted.task test,task lintandtask mutate(86 refused, 0 survived) pass locally.Not covered
/procthere is no bound.Each repository takes it with
go get github.com/spin-stack/go-tools@<commit>.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.