test: rerun flaky test_http_2 on transient HTTP/2 connection termination#2057
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2057 +/- ##
==========================================
- Coverage 93.42% 93.41% -0.02%
==========================================
Files 179 179
Lines 12495 12495
==========================================
- Hits 11674 11672 -2
- Misses 821 823 +2
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:
|
Pijukatel
approved these changes
Jul 10, 2026
Mantisus
pushed a commit
to Mantisus/crawlee-python
that referenced
this pull request
Jul 10, 2026
…ion (apify#2057) `test_http_2` sends a real request to `https://apify.com/` to verify HTTP/2 negotiation across the three HTTP clients (`curl`, `httpx`, `impit`). Occasionally the server/CDN gracefully terminates the HTTP/2 connection with a GOAWAY frame (`error_code:0`), which `httpx`/`httpcore` surface as `RemoteProtocolError: <ConnectionTerminated ...>` without retrying. Crawlee's `send_request` just re-raises the transport error, so the test fails intermittently in CI (seen on macos-latest / 3.11 — [run 29007732402](https://github.com/apify/crawlee-python/actions/runs/29007732402/job/86083355443)). The flakiness is external — we don't control apify.com's connection lifecycle — and the test's purpose is to exercise real HTTP/2 negotiation, so it can't be mocked and the local test server is plain HTTP/1.1. Following the project's documented flaky-test policy (`tests/unit/README.md`), the test is marked `@pytest.mark.flaky(reruns=3)`. A fresh rerun reconnects and negotiates HTTP/2 cleanly, while a genuine HTTP/2 regression would still fail every attempt.
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.
test_http_2sends a real request tohttps://apify.com/to verify HTTP/2 negotiation across the three HTTP clients (curl,httpx,impit). Occasionally the server/CDN gracefully terminates the HTTP/2 connection with a GOAWAY frame (error_code:0), whichhttpx/httpcoresurface asRemoteProtocolError: <ConnectionTerminated ...>without retrying. Crawlee'ssend_requestjust re-raises the transport error, so the test fails intermittently in CI (seen on macos-latest / 3.11 — run 29007732402).The flakiness is external — we don't control apify.com's connection lifecycle — and the test's purpose is to exercise real HTTP/2 negotiation, so it can't be mocked and the local test server is plain HTTP/1.1. Following the project's documented flaky-test policy (
tests/unit/README.md), the test is marked@pytest.mark.flaky(reruns=3). A fresh rerun reconnects and negotiates HTTP/2 cleanly, while a genuine HTTP/2 regression would still fail every attempt.