Skip to content

test(dev-loop): stop a pipefail flake in the dispatch-budget check - #1245

Merged
aaronjmars merged 2 commits into
mainfrom
fix/dev-loop-proof-test-pipefail
Oct 18, 2026
Merged

aaronjmars merged 2 commits into
mainfrom
fix/dev-loop-proof-test-pipefail

Conversation

@aaronjmars

@aaronjmars aaronjmars commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

What

test_dev_loop_proof.sh and test_dev_loop_repair.sh piped the dev-loop: block of aeon.yml from sed into grep -Fq. The block is about 4.8 KB, over sed's 4 KB pipe buffer, so sed writes it in two chunks. When grep -q matches on the first chunk it exits, sed's second write hits a broken pipe, and under set -o pipefail the check fails at random.

Seen on #1244 (run 39135349362, lane 6):

sed: couldn't flush stdout: Broken pipe
dev-loop dispatch budget is not five

A rerun of the same commit passed.

Fix

Capture the block into a variable first, then grep a here-string, like the checkout_block / commit_block checks above it already do. Same check, no pipe.

Checked

  • Both tests pass locally.
  • shellcheck -S warning is clean on both files.
  • Not reproducible on macOS in 2000 tries with either BSD sed or GNU sed. The CI log above is the evidence for the race.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…fail flake

The dev-loop block in aeon.yml is about 4.8 KB, over sed's 4 KB pipe buffer, so sed writes it in two chunks. When grep -q matches on the first chunk it exits, sed's second write hits a broken pipe, and under set -o pipefail the check fails at random (seen on aeon#1244 run 39135349362: sed couldn't flush stdout, then 'dev-loop dispatch budget is not five'). Capture the block first, then grep a here-string, in both dev-loop tests.
…er comment

The step 0 block in idea-pipeline is over 4 KB, so the sed | grep -q pipe
under pipefail could turn its negative check into a silent pass. Capture
both blocks first, fail if a block is missing, then grep a here-string.
Also reword the comment in the dev-loop proof and repair tests: the 4 KB
limit is sed's own stdout buffer, not the pipe buffer.

Co-Authored-By: Claude <noreply@anthropic.com>
@aaronjmars
aaronjmars merged commit 8884b68 into main Oct 18, 2026
4 checks passed
@aaronjmars aaronjmars mentioned this pull request Oct 20, 2026
6 tasks done
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