gendesign/tradein-mvp/backend/tests/tasks
bot-backend a50af40ad6
All checks were successful
CI / changes (pull_request) Successful in 7s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
fix(tradein/avito): reap dead 404 listings in detail backfill (don't trip block breaker)
avito_detail_backfill (mode=browser) aborted prod run 458 with
attempted=5 enriched=0 blocked=5: the lat-null pending queue is dominated
by DEAD listings (404 — that's why they are stale coord-holes). In browser
mode a dead listing's 404 page ("Ошибка 404. Страница не найдена") has no
item-view, so _is_detail_soft_block returned True → AvitoBlockedError →
backfill counted it as `blocked` and the consecutive-block breaker aborted
the run before reaching live listings.

- New AvitoListingGoneError (subclass of common AvitoError, NOT of
  AvitoBlockedError/AvitoRateLimitedError) so the backfill block-trap
  does not catch it.
- New _is_detail_not_found() detector + browser-mode branch in fetch_detail,
  checked BEFORE firewall/soft-block (keyed on the 404 title so it does not
  swallow the generic soft-block deflect). Curl path unchanged (404 → 302/
  non-200 → ValueError → failed, as before).
- Backfill: new `gone` counter; dedicated except AvitoListingGoneError branch
  that is neutral to the consecutive-block breaker and marks the listing
  is_active=FALSE (SAVEPOINT) so it leaves the snapshot scope.

Tests: unit for _is_detail_not_found (404 True; soft-block/item-view/empty
False), browser-mode fetch_detail raising AvitoListingGoneError (not Blocked),
and backfill gone-row marks inactive without aborting the breaker.
2026-06-28 14:05:31 +03:00
..
__init__.py fix(tradein): geocode backfill + remove Avito exclusion from estimator (#490) 2026-05-23 20:03:48 +00:00
test_avito_detail_backfill.py fix(tradein/avito): reap dead 404 listings in detail backfill (don't trip block breaker) 2026-06-28 14:05:31 +03:00
test_backfill_listings_coords_geoportal.py feat(tradein): бэкфилл координат листингов из ekb_geoportal_buildings (street+house match) 2026-06-20 17:08:46 +03:00
test_cadastral_geo_match.py fix(cadastral): single-statement match UPDATE — OFFSET chunk skipped rows 2026-06-18 10:28:19 +03:00
test_geocode_missing.py fix(tradein): wire nightly geocode backfill для listings в in-app scheduler 2026-06-16 10:01:49 +03:00
test_newbuilding_enrich_backfill.py feat(tradein-scheduler): nightly newbuilding-enrichment schedule (#973) 2026-06-13 16:24:03 +05:00
test_yandex_address_backfill.py fix(tradein): yandex address-enrich — city-agnostic title regex (спутники ЕКБ) (#875) 2026-05-31 09:08:29 +00:00
test_yandex_detail_backfill.py fix(tradein): yandex detail backfill — заменить fetch_detail на curl_cffi+proxy 2026-06-16 14:05:22 +03:00
test_yandex_newbuilding_sweep.py fix(tradein): yandex sweep — guard ext_id=NULL перед fetch_jk + cleanup httpx (#974 review M1/M3) 2026-06-15 18:41:08 +03:00