Deflake the initialize dial-error proxy test - #6264
Merged
Merged
Conversation
TestRoundTripDoesNotReplayInitializeOnDialError failed intermittently in a full-suite run with "Received unexpected error" on the HTTP call, while passing every time in isolation. It used http.DefaultClient, whose shared transport pools keep-alive connections across this package's parallel tests. Reusing one whose proxy has since been closed surfaces as a transport error before the request is made. Use a dedicated client with keep-alives disabled. The HTTP outcome is also not what the test asserts. For a dial failure either result is legitimate -- the reverse proxy may synthesize a 502, or the connection may fail outright -- so requiring NoError pinned an incidental detail. The substantive assertions, that no re-initialize reached the target service and that the session was unpinned, are unchanged and still fail when the production guard is removed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
amirejaz
requested review from
ChrisJBurns,
JAORMX,
blkt,
jhrozek and
rdimitrov
as code owners
August 10, 2026 17:56
ChrisJBurns
approved these changes
Aug 10, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6264 +/- ##
==========================================
- Coverage 72.71% 72.70% -0.01%
==========================================
Files 742 742
Lines 77299 77299
==========================================
- Hits 56209 56204 -5
- Misses 17126 17134 +8
+ Partials 3964 3961 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
TestRoundTripDoesNotReplayInitializeOnDialErrorfails intermittently in a full-suite run withReceived unexpected erroron the HTTP call, while passing every time in isolation (6/6 plain, 4/4 with-race).It used
http.DefaultClient, whose shared transport pools keep-alive connections across this package's parallel tests. Reusing one whose proxy has since been closed surfaces as a transport error before the request is even made.DisableKeepAlives.NoErroron the request itself. For a dial failure either outcome is legitimate — the reverse proxy may synthesize a 502, or the connection may fail outright — so that assertion pinned an incidental detail rather than the behaviour under test.Type of change
Test plan
task test)task lint-fix)Package green with
-race, and the test still fails when the production guard it covers is removed:So the relaxed HTTP assertion did not weaken what the test actually guards.
Does this introduce a user-facing change?
No. Test-only.
Special notes for reviewers
Mine from #6152, surfaced in a full-suite run rather than CI. Other tests in this file use
http.DefaultClienttoo and are presumably exposed to the same reuse hazard; I have left them alone rather than widen this beyond the test that actually failed.Generated with Claude Code