Repository navigation
Commit 0fdc362
authored
test: Mark test_http_status_statistics as flaky (#1869)
## Summary
`test_http_status_statistics[httpx]` failed intermittently on macOS
Python 3.12 CI ([example
run](https://github.com/apify/crawlee-python/actions/runs/25331165214/job/74264952104?pr=1864))
with `'500': 39` vs expected `'500': 40`.
Each `status/500` URL gets 4 attempts (1 initial + 3 retries from
`max_request_retries=3`). The httpx client only calls
`register_status_code` after a successful response (`_httpx.py:175`); a
transient transport error (TCP reset / h2 stream hiccup, common on
macOS-hosted runners under load) raises before that line, so the retry
budget is consumed without bumping the counter — yielding 39 instead of
40.
Production behavior is correct; only the test's exact-count assumption
is fragile under CI network noise. Marking the test with
`@pytest.mark.flaky(reruns=3, ...)` follows the existing convention used
for the same class of flake (e.g. `test_basic_crawler.py:1376`).1 parent 65bf68d commit 0fdc362
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
223 | 227 | | |
224 | 228 | | |
225 | 229 | | |
| |||
0 commit comments