trustgraph/tests/unit/test_concurrency
cybermaggedon c20e6540ec
Subscriber resilience and RabbitMQ fixes (#765)
Subscriber resilience: recreate consumer after connection failure

- Move consumer creation from Subscriber.start() into the run() loop,
  matching the pattern used by Consumer. If the connection drops and the
  consumer is closed in the finally block, the loop now recreates it on
  the next iteration instead of spinning forever on a None consumer.

Consumer thread safety:
- Dedicated ThreadPoolExecutor per consumer so all pika operations
  (create, receive, acknowledge, negative_acknowledge) run on the
  same thread — pika BlockingConnection is not thread-safe
- Applies to both Consumer and Subscriber classes

Config handler type audit — fix four mismatched type registrations:
- librarian: was ["librarian"] (non-existent type), now ["flow",
  "active-flow"] (matches config["flow"] that the handler reads)
- cores/service: was ["kg-core"], now ["flow"] (reads
  config["flow"])
- metering/counter: was ["token-costs"], now ["token-cost"]
  (singular)
- agent/mcp_tool: was ["mcp-tool"], now ["mcp"] (reads
  config["mcp"])

Update tests
2026-04-07 14:51:14 +01:00
..
__init__.py Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_consumer_concurrency.py Subscriber resilience and RabbitMQ fixes (#765) 2026-04-07 14:51:14 +01:00
test_dispatcher_semaphore.py Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_graph_rag_concurrency.py Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00