Repository navigation
test: let the auto-read-off replay test accept a chunk delivered before the replay - #2368
Merged
Merged
Conversation
ioExceptionReplayDrainsTheOldConnectionWithAutoReadDisabled failed in about one run in ten, as on macOS with JDK 21 in CI. The server sends the first response's chunk right after its head; when both arrive in the same read, the handler receives the chunk before the I/O error replays the request. That is correct, but the test took the chunk for part of the replayed body. Record onRetry, allow the first chunk only before it, and check that the replayed body follows it directly. Over 50 repetitions, the old assertion failed 7 times on JDK 11 and once on JDK 25, the new one never, and every failure had the chunk before onRetry. Without the fix in NettyRequestSender, the test still fails every time. Claude Code on behalf of Matthias Kurz Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Green 😉 |
hyperxpro
approved these changes
Nov 4, 2026
14 tasks done
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
ResponseBodyControlTest.ioExceptionReplayDrainsTheOldConnectionWithAutoReadDisabled, added in fix(netty): detach a replayed request's old channel before completing its body control #2367. It failed on macOS with JDK 21 in fix(netty): detach a replayed request's old channel before completing its body control #2367's first CI run, and about once in ten runs locally.Problem
The test's server sends the first response's chunk right after its head. When both arrive in the same read, the handler receives the chunk before the injected I/O error replays the request. That is correct, since a suspension does not hold back what has already been read, but the test took the chunk for part of the replayed body (
expected: <replayed> but was: <first>).Recording the order of events over 50 repetitions on JDK 11: 3 runs had the chunk before
onRetry, none after it.Change
The test records
onRetry, allows the first response's chunk only before it, and checks that the replayed body follows it directly. What the test is about is unchanged: with auto-read off, the old connection must still be drained and closed.AI disclosure
Claude Code on behalf of Matthias Kurz. The commit includes
Co-Authored-ByperAGENTS.md.Test plan
NettyRequestSender, every one of 50 repetitions still fails, on the drain assertion../mvnw -B -ntp -Dgpg.skip=true clean verifyon JDK 11, on a tree identical to this branch: 1,821 tests, 0 failures, 0 errors, 11 skipped; Revapi passed. No test-skipping flags were used.ResponseBodyControlTestandHttp2ResponseBodyControlTest, compiled on JDK 11 and run on JDK 17, 21 and 25 (Maven Surefire's-Djvm): 20 tests each, 0 failures.