deer-flow/backend/tests/AGENTS.md
yeejhyang 5e85f8a183
fix(runtime): add deterministic executor starvation regressions (#5335)
* test(runtime): add deterministic executor starvation regressions

* docs(tests): document executor starvation test contract

* fix(runtime): address executor starvation review feedback

* docs(tests): clarify executor cleanup guidance

* docs(tests): clarify executor cleanup guidance

* docs(tests): clarify executor cleanup guidance

* test(runtime): apply remaining ruff formatting fix

* test(runtime): register executor test guidance path

* test(runtime): bound dedicated executor regression wait

* test(ci): align guidance budget test with checker semantics
2026-09-12 10:59:31 +08:00

958 B

Backend Tests

Backend tests must preserve the runtime invariants they exercise without changing production execution topology.

Executor starvation tests

test_executor_starvation.py covers the deterministic starvation semantics from RFC #4560:

  • default-executor saturation and queueing;
  • cancellation of an awaiter while an already-started synchronous worker continues;
  • isolation between the asyncio default executor and DeerFlow's dedicated file-I/O executor.

Use explicit synchronization such as threading.Event rather than sleep-based timing thresholds for worker lifecycle assertions. Every test must release blocked workers and restore any process-global monkeypatches so teardown cannot leak threads or state into later tests.

Stress/soak testing, AnyIO worker instrumentation, Uvicorn multi-process behavior, and broad production executor redesign are separate concerns and should not be folded into these deterministic regressions.