From 182280f5bd8f9adafcd5cdd8097432215deef67b Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 6 May 2026 10:54:33 +0200 Subject: [PATCH] test: mark test_adaptive_crawling_pre_nav_change_to_context as flaky On Windows CI, Playwright occasionally hits net::ERR_NO_BUFFER_SPACE during Page.goto, causing a request retry that fires the pre-nav hook one extra time. The test's intent (no user_data leakage between probes) still holds, but the hard-coded count of 2 invocations breaks. Match the existing pattern used elsewhere in the file for similar Windows-only network flakiness. --- .../_adaptive_playwright/test_adaptive_playwright_crawler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/crawlers/_adaptive_playwright/test_adaptive_playwright_crawler.py b/tests/unit/crawlers/_adaptive_playwright/test_adaptive_playwright_crawler.py index 84d95fe702..f00004ca3a 100644 --- a/tests/unit/crawlers/_adaptive_playwright/test_adaptive_playwright_crawler.py +++ b/tests/unit/crawlers/_adaptive_playwright/test_adaptive_playwright_crawler.py @@ -236,6 +236,11 @@ async def request_handler(context: AdaptivePlaywrightCrawlingContext) -> None: assert static_handler_count == 1 +@pytest.mark.flaky( + rerun=3, + reason='Test is flaky on Windows when Playwright hits net::ERR_NO_BUFFER_SPACE and retries, ' + 'causing the pre-nav hook to fire one extra time.', +) async def test_adaptive_crawling_pre_nav_change_to_context(test_urls: list[str]) -> None: """Tests that context can be modified in pre-navigation hooks.""" static_only_predictor_enforce_detection = _SimpleRenderingTypePredictor()