deerflow2/backend/tests/blocking_io
ly-wang19 420a886e1d
fix(channels): offload blocking filesystem IO in inbound file ingestion (#3529)
_ingest_inbound_files ensured the thread uploads dir (mkdir), enumerated it
(iterdir/is_file) to de-duplicate names, and wrote each downloaded attachment
(write_upload_file_no_symlink) directly on the event loop. Offload the directory
prep and every per-file write via asyncio.to_thread; the genuinely async network
read (file_reader) stays on the loop. Externally observable behavior is unchanged.

Found via `make detect-blocking-io` (HIGH: iterdir on an async path).

Add tests/blocking_io/test_channels_ingest.py anchor, verified red->green under
the strict Blockbuster gate.

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 06:38:54 +08:00
..
__init__.py feat(tests): add Blockbuster runtime gate for event-loop blocking IO (#3229) 2026-05-26 23:03:49 +08:00
conftest.py feat(tests): add Blockbuster runtime gate for event-loop blocking IO (#3229) 2026-05-26 23:03:49 +08:00
test_agents_router.py fix(agents): offload blocking filesystem IO in the custom-agent router off the event loop (#3457) 2026-06-09 22:24:53 +08:00
test_channel_runtime_config_store.py feat(im): Add user-owned IM channel connections (#3487) 2026-06-12 15:24:58 +08:00
test_channels_ingest.py fix(channels): offload blocking filesystem IO in inbound file ingestion (#3529) 2026-06-13 06:38:54 +08:00
test_dynamic_context_middleware.py fix(middleware): offload memory injection off event loop to prevent tiktoken blocking (#3402) (#3411) 2026-06-08 12:21:55 +08:00
test_gate_smoke.py feat(tests): add Blockbuster runtime gate for event-loop blocking IO (#3229) 2026-05-26 23:03:49 +08:00
test_jsonl_run_event_store.py test(runtime): add Blockbuster runtime anchor for JsonlRunEventStore async IO (#3313) 2026-05-29 23:02:41 +08:00
test_skills_install.py fix(skills): keep skill archive installation off the event loop (#3505) 2026-06-12 15:17:40 +08:00
test_skills_load.py feat(tests): add Blockbuster runtime gate for event-loop blocking IO (#3229) 2026-05-26 23:03:49 +08:00
test_sqlite_lifespan.py feat(tests): add Blockbuster runtime gate for event-loop blocking IO (#3229) 2026-05-26 23:03:49 +08:00
test_uploads_middleware.py fix(agents): offload UploadsMiddleware uploads scan off the event loop (#3311) 2026-05-30 21:46:35 +08:00