01_engine-xfread flakes on a SIGPIPE race under pipefail#637
Merged
Conversation
The test matched engine output with `echo "$out" | grep -q PATTERN`. Under
`set -o pipefail`, grep -q exits the moment it matches, so echo takes a SIGPIPE
writing the rest and the pipeline reports failure even though the pattern was
found. The `|| { echo FAIL; exit 1; }` guard then fired on a passing case,
turning it into an intermittent, output-size-dependent failure (seen on the
Debian buildd leg of #632).
Match with here-strings instead, dropping the pipe and the race entirely.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.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.
The test matched engine output with
echo "$out" | grep -q PATTERN. Underset -o pipefail,grep -qexits the moment it matches, soechotakes a SIGPIPE writing the rest of its output and the pipeline reports failure even though the pattern was found. The|| { echo FAIL; exit 1; }guard then fired on a passing assertion, so the test failed intermittently depending on output size and scheduling. It showed up on the Debian buildd leg of #632, a PR that does not touch this code.Switching the three matches to here-strings (
grep -q PATTERN <<<"$out") drops the pipe, so there is no early reader to SIGPIPE the writer. A deterministic control confirms the mechanism: the old form exits 141 when grep matches the first of many lines, the here-string form exits 0. The fixed test ran 200 times with no failures.Pre-existing flake, independent of the batch fixes, so it gets its own PR.