Skip to content

fix(agents): read selftest output via herestrings to avoid CI SIGPIPE - #729

Closed
thxCode wants to merge 1 commit into
mainfrom
fix/check-specs-selftest-sigpipe
Closed

thxCode wants to merge 1 commit into
mainfrom
fix/check-specs-selftest-sigpipe

Conversation

@thxCode

@thxCode thxCode commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind bug
/area testing

What this PR does / why we need it:

The check workflow's docs leg fails on Linux CI while the same selftest passes on macOS. Root cause: check-specs-selftest.sh asserts on captured run output with printf '%s' "$out" | grep -q .... grep -q exits on the first match; when the captured output exceeds the 64 KiB pipe buffer, printf is still writing, dies with SIGPIPE, and the pipeline status no longer reflects the match — the assertion fails although the pattern is present. macOS never fills the buffer for these outputs, so the failure is Linux-only.

Fix: read the variable through a herestring (grep -q ... <<< "$out"). No pipe, no writer to signal, same grep exit status. All five assertion sites in the script are converted; no other printf | grep pipelines exist in the file.

Which issue(s) this PR links to:

None — the failure was observed directly in the check workflow on main.

Special notes for your reviewer:

Verified locally: bash -n clean, selftest passes (SELFTEST PASSED: every rule was seen to fail on the shape it claims to catch), make lint agents-shell green. The fix is semantics-preserving (identical grep exit status) and removes the signal by construction.

Does this PR introduce a user-facing change?

NONE

The check-specs selftest asserted on captured output with
`printf '%s' "$out" | grep -q ...`. grep -q exits on the first match;
when the captured run output exceeds the 64 KiB pipe buffer (Linux CI,
not macOS where the buffer never fills), printf dies with SIGPIPE
mid-write and the pipeline status no longer reflects the match,
failing the assertion. Read the variable through a herestring instead:
no pipe, no writer to signal, same grep exit status.

Detected by the check workflow's docs leg failing on main while the
same selftest passes locally.

Signed-off-by: thxCode <thxcode0824@gmail.com>
@gpustack-code-review

Copy link
Copy Markdown

✅ OpenCodeReview: Review skipped: no items were selected.

@thxCode

thxCode commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

Duplicate of #728 — same five herestring conversions of the same file, opened four minutes earlier with CI already green. Closing this one; the fix lands via #728.

@thxCode thxCode closed this Oct 6, 2026
@thxCode
thxCode deleted the fix/check-specs-selftest-sigpipe branch October 7, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant