Commit Graph

6 Commits

Author SHA1 Message Date
Shihab Shahriyar c6c9c4efd8 fix(feedexport): persist batch_id across JOBDIR restarts
When a crawl with FEED_EXPORT_BATCH_ITEM_COUNT (or FEEDS.batch_item_count)
and a %(batch_id) URI template was restarted with the same JOBDIR, the
in-memory batch counter reset to 1 and silently overwrote files produced
by the previous run.

Store the last successfully-written batch_id per uri_template in
<JOBDIR>/feedexport.state (JSON) and resume from last+1 on the next
run. The state file is only written when JOBDIR is set and the URI
template references %(batch_id), so non-JOBDIR crawls and time-only
templates behave exactly as before. Adds a regression test that runs
the exporter twice against the same JOBDIR and asserts prior batch
files are not overwritten.

Closes #5153
2026-06-22 18:25:27 -05:00
Andrey Rakhmatullin 3a36955261
Assorted test fixes (#7616) 2026-06-15 08:39:58 +02:00
Andrey Rakhmatullin 55c17a8985
Disable mypy allow_any_generics. (#7532) 2026-05-18 15:54:06 +02:00
Andrey Rakhmatullin bfe34492fa
asyncio alternative to deferToThread() (#7349) 2026-03-24 15:41:15 +01:00
Andrey Rakhmatullin 6fe27ba33e
Add more no-reactor tests (#7259)
* Generic changes and scrapy bench.

* scrapy check.

* scrapy crawl.

* scrapy fetch.

* scrapy parse.

* scrapy runspider.

* scrapy shell.

* Skip httpx tests on default-reactor.

* Review requires_reactor marks.

* Make test functions that require an event loop async def.

* Improve test_pending_asyncio_tasks().

* Add Mac OS DNS error.

* Refactor most of test_scheduler.py.

* Finish refactoring DownloaderAwareSchedulerTestMixin.

* Refactor test_engine_loop.py.

* Add the no-reactor-extra-deps tox env, run no-reactor on macos.

* Skip unhandled CancelledError when shutting down the engine.

* Fix typing and pre-commit checks.

* Fix typing problems in master.

---------

Co-authored-by: Adrian <adrian@zyte.com>
2026-03-24 15:29:22 +05:00
Andrey Rakhmatullin 584d99af30
Split long test files (#7329) 2026-03-13 10:30:25 +01:00