Fix ARG_MAX overflow in stderr blob test on Linux CI - #3
Merged
Merged
Conversation
A 200,000-byte literal in argv exceeds ARG_MAX on a Linux runner whose inherited environment is already large, so execve fails E2BIG before the stderr drain under test ever runs. The child generates the blob instead; the assertions are unchanged. Claude-Session: https://claude.ai/code/session_014gKfZvjihGgFrEVCr3NJJb Claude-Session-Id: 2eb2d69e-c564-4401-84fb-d22d217b5ff7
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
tests/test_proc.py::TestArunCli::test_stderr_newline_free_blob_past_64kbuilt its child command by interpolating a 200,000-byte literal intoargvthrough an f-string repr. On the Linux CI runners, argv plus the runner's large inherited environment exceeds the kernel'sARG_MAX, soexecvefails before the child starts:The child now generates the blob itself (
sys.stderr.write('e' * 200_000)) instead of receiving it, so argv stays small. The test's subject is unchanged: it still asserts that a newline-free 200,000-byte stderr blob past the 64 KiB readline limit is captured whole rather than lost to aLimitOverrunErrormid-drain, and still checks the exit code,exc.value.stderr, and the teed bytes.This is a pre-existing break on
main, not a regression from any open branch. The test arrived with #6 ("Fix stderr drain crashing on newline-free blobs past 64 KiB"), and everyci.ymlrun onmainsince has failed, blocking CI for every PR in the repo. It is not a flake: it fails deterministically on both the 3.13 and 3.14 jobs, so a rerun does not clear it. It passes on macOS, where argv has more headroom against a smaller inherited environment, which is why it went unnoticed locally.Test plan
uv run --extra dev pytest tests/test_proc.py -k stderrpasses locally.https://claude.ai/code/session_014gKfZvjihGgFrEVCr3NJJb