Repository navigation
test: stabilize HTTP client tests for read after timeout and connection reuse - #2373
Merged
Merged
Conversation
vdusek
marked this pull request as ready for review
October 31, 2026 06:38
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #2373 +/- ##
=====================================
Coverage ? 94.29%
=====================================
Files ? 187
Lines ? 13838
Branches ? 0
=====================================
Hits ? 13048
Misses ? 790
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ 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.
Two tests added in #2349 fail intermittently in CI (seen on #2371).
test_closing_unread_response_reuses_connection[impit]: impit returns a drained connection to its pool in the background, so the request sent right after a close sometimes opens a second connection. Under load this failed in 2 of 120 local runs. The test now allows up to two connections. A working client opens 1 or 2, and one that drops the connections of closed responses always opens 3 (300 runs each), so the test still catches that regression.test_read_again_after_timeout[httpx]: the 200 ms timeout covered the whole request, and the slow macOS runner didn't get the headers in time. The test now uses a 10 s timeout and moves the event loop clock past the deadline before the secondread(), so it doesn't wait on the wall clock.Both tests still fail when the behavior they cover is broken. After the change, 1,440 runs under load passed.
✍️ Drafted by Claude Code