From 18aa8257637b46ead62d044adb58d5f81f4ea6c2 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Mon, 4 May 2026 19:13:59 +0200 Subject: [PATCH] test: Mark test_http_status_statistics as flaky Transient transport errors in macOS CI can consume the retry budget without reaching register_status_code, causing the exact-count assertion to fail (39 vs 40 for status 500). Reuses the existing flaky-rerun convention used elsewhere in the suite for CI-environment-induced flakes. --- tests/unit/crawlers/_http/test_http_crawler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/crawlers/_http/test_http_crawler.py b/tests/unit/crawlers/_http/test_http_crawler.py index 99da10776d..7d6fbfda0b 100644 --- a/tests/unit/crawlers/_http/test_http_crawler.py +++ b/tests/unit/crawlers/_http/test_http_crawler.py @@ -220,6 +220,10 @@ async def test_do_not_retry_on_client_errors(crawler: HttpCrawler, server_url: U assert stats.requests_total == 1 +@pytest.mark.flaky( + reruns=3, + reason='Transient transport errors in CI can consume retry budget without registering a status code.', +) async def test_http_status_statistics(crawler: HttpCrawler, server_url: URL) -> None: await crawler.add_requests([str(server_url.with_path('status/500').with_query(id=i)) for i in range(10)]) await crawler.add_requests([str(server_url.with_path('status/402').with_query(id=i)) for i in range(10)])