Repository navigation
Fix intermittent failure in t/modules/sed.t - #23
Merged
Merged
Conversation
case. mod_sed fails with ENOMEM once the substituted line grows past MAX_BUF_SIZE, and whether a 200 was sent first depends on where the last socket read lands, so the test failed intermittently. Co-Authored-By: Claude Opus 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.
t/modules/sed.ttest 3 fails intermittently. Seen on an httpd CI run(job),
where the harness's own
-vre-run of the same file then passed, as did thesame job on the next push.
The case POSTs 24 MiB through
mod_echo_postwith anOutputSedwhich growseach line.
mod_sedgives up withAPR_ENOMEMonce the substituted lineexceeds
MAX_BUF_SIZE, loggingAH103942048 times in both the passing andthe failing run. What differs is where the last socket read lands:
ap_rwrite()exceeds thefree space in the
ap_old_writebuffer and flushes inline. Nothing is leftat EOS, sed's EOS branch succeeds, and a
200goes out.buffer, so it is flushed together with the EOS.
sed_response_filter()failson that brigade and
breaks without callingap_pass_brigade(), so the EOSis dropped and the header filters never run. No response bytes are written at
all, and the client sees a clean EOF.
So the test asserts a status code for a case whose outcome depends on TCP read
boundaries. This accepts either, while still rejecting the
400that theneighbouring commented-out case mentions. There is precedent in this file:
c20d4f3 disabled a sibling entry for the same class of flakiness.
Not fixed here, and worth a look separately:
sed_response_filter()droppingthe EOS means a request can end with no response whatsoever, rather than a
truncated 200 or a 500. That is httpd's
modules/filters/mod_sed.c.Note: I could not run this test locally to confirm, as
LWP::Protocol::AnyEvent::httpis not available here and the whole file skipswithout it. The change is syntax-checked, and
t_is_equal()does support aRegexpas the expected value.🤖 Generated with Claude Code