fix(chromium): fix 3 P0 bugs and 2 P1 issues in chromium loader + cleanups#1088
fix(chromium): fix 3 P0 bugs and 2 P1 issues in chromium loader + cleanups#1088ghshhf wants to merge 4 commits into
Conversation
- P0-1: Fix timeout=0 guard short-circuit (if timeout is not None) - P0-2: Guard finally: await browser.close() against None - P0-3: Guard finally: driver.quit() against unbound variable - P1-2: Fix _get_scraping_fn() for selenium backend dispatch - P1-4: Remove redundant kwargs.get() for direct params
…erMultiConcatGraph
|
Thanks for the PR — the core Blocking — Tests are too loose. Both A couple of smaller, non-blocking notes on the source fixes:
Also consider splitting the unrelated changes (the |
Summary
This PR fixes 3 critical (P0) bugs and 2 high-priority (P1) issues in the chromium loader.
P0 Bugs Fixed
P0-1:
timeout=0guard short-circuit causes 6h CI hangFile:
chromium.py:130Root cause:
if timeout and timeout <= 0- When timeout=0,0 and ...short-circuits to falsy, so the ValueError is never raised. Execution falls through to real network calls, causing the test suite to hang until the 6h CI kill limit.Fix: Changed to
if timeout is not None and timeout <= 0.P0-2:
finally: await browser.close()may raise UnboundLocalErrorFile:
chromium.py:188Root cause: If browser is None (invalid browser_name) or never assigned (async_playwright fails), the finally block crashes.
Fix: Added
if browser is not Noneguard.P0-3:
finally: driver.quit()may reference unbound variableFile:
chromium.py:101Root cause: If driver initialization fails,
driveris never assigned.Fix: Added scope check before
driver.quit().Additional Fixes
_get_scraping_fn()that properly routes toascrape_undetected_chromedriverscraperaphai->scrapegraphaiin pyproject.toml