Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2207 +/- ##
==========================================
- Coverage 93.74% 93.73% -0.01%
==========================================
Files 181 181
Lines 12852 12854 +2
==========================================
+ Hits 12048 12049 +1
- Misses 804 805 +1
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:
|
vdusek
added a commit
that referenced
this pull request
Sep 8, 2026
…2221) Two adaptive crawler tests flake on the Windows CI shard for the same reason. This supersedes #2207, which fixed one of them from a base that predates #2203. The browser sub crawler navigates under `PlaywrightCrawler`'s own `navigation_timeout`, a 60s `SharedTimeout` shared by the pre/post-navigation hooks and `goto`. That budget is separate from `request_handler_timeout`, because `BasicCrawler` applies the handler timeout only around the router call. So a cold Chromium launch on a saturated runner can blow the navigation budget while the handler timeout still has minutes left, and relaxing the handler timeout does nothing about it. - `test_adaptive_crawling_statistics` fails with `assert 3 == 1` ([example run](https://github.com/apify/crawlee-python/actions/runs/34120120329/job/101736011265)). When navigation exceeds the 60s budget, `BasicCrawler` retries the whole request, which is correct behavior, and every adaptive counter increments again. The failing run timed out twice before succeeding: 60 + 60 + 17s matches its 146s crawler runtime. It now passes a 5 minute `navigation_timeout`, the same ceiling #2203 already gave its handler. - `test_adaptive_playwright_crawler_timeout_in_sub_crawler` fails with `Expected 'browser_handler' to be called once. Called 0 times.` ([example run](https://github.com/apify/crawlee-python/actions/runs/33467016711/job/99728873095)). It sets `max_request_retries=0`, so one slow navigation fails the only attempt before the handler ever runs. It now passes a 120s `navigation_timeout`, matching the handler timeout it already relaxes. Both keep their existing assertions, so a real double-counting or missed-increment regression still fails them. Passing the key needs `navigation_timeout` in `_PlaywrightCrawlerAdditionalOptions`; `PlaywrightCrawler.__init__` already accepts it and `ty` reports `invalid-key` without it. Verified with deterministic fault injection in both cases. For the statistics test, monkeypatching `Page.goto` to stall the first two navigations by 70s reproduces the exact `assert 3 == 1` with two retries under the 60s ceiling, and passes in 71s under the 5 minute one with all counters at 1; plus 0 failures in 39 runs of that test alone and 31/31 for the whole file serially. For the sub crawler timeout test, a playwright-only pre-navigation delay of 70s consumes the shared budget and reproduces the CI failure under the default ceiling, passing under 120s, with 0/96 failures across 8 concurrent Chromium-saturated lanes afterwards. The adaptive module passes under `-n auto` in 6 of 7 runs; the exception hit an unrelated `Errno 98` in the uvicorn test server fixture, caused by running several pytest processes at once locally. *✍️ Drafted by Claude Code*
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_adaptive_playwright_crawler_timeout_in_sub_crawlerfails intermittently on Windows CI withExpected 'browser_handler' to be called once. Called 0 times.(example run).
The fallback browser request navigates under the Playwright sub-crawler's own
navigation_timeout(default 1 minute) - a budget separate from the request handler timeout the test already relaxes to
120s. On a saturated runner (8 xdist workers, each driving Chromium)
page.gotocan exceed it, andwith
max_request_retries=0that single slow navigation fails the only attempt before the handlerever runs.
The test now grants navigation the same 120s ceiling via
playwright_crawler_specific_kwargs. Topass that type-safely, the missing
navigation_timeoutkey is added to_PlaywrightCrawlerAdditionalOptions- typing only,PlaywrightCrawler.__init__already accepts it.Verified by deterministic fault injection (a playwright-only pre-navigation delay consuming the
shared navigation budget): a 70s navigation-phase delay reproduces the exact CI failure under the
default ceiling and passes under the 120s one. After the fix, 0/96 failures across 8 concurrent
Chromium-saturated lanes, and the adaptive + playwright test modules pass under
-n auto. Theassertions are unchanged.
✍️ Drafted by Claude Code