trustgraph/tests/unit/test_storage
cybermaggedon a2dde9cafb
Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916)
Cassandra triples services were using syncronous EntityCentricKnowledgeGraph
methods from async contexts, and connection state was managed with
threading.local which is wrong for asyncio coroutines sharing a single
thread. Qdrant services had no async wrapping at all, blocking the event
loop on every network call. Rows services had unprotected shared state
mutations across concurrent coroutines.

- Add async methods to EntityCentricKnowledgeGraph (async_insert,
  async_get_s/p/o/sp/po/os/spo/all, async_collection_exists,
  async_create_collection, async_delete_collection) using the existing
  cassandra_async.async_execute bridge
- Rewrite triples write + query services: replace threading.local with
  asyncio.Lock + dict cache for per-workspace connections, use async
  ECKG methods for all data operations, keep asyncio.to_thread only for
  one-time blocking ECKG construction
- Wrap all Qdrant calls in asyncio.to_thread across all 6 services
  (doc/graph/row embeddings write + query), add asyncio.Lock + set cache
  for collection existence checks
- Add asyncio.Lock to rows write + query services to protect shared
  state (schemas, sessions, config caches) from concurrent mutation
- Update all affected tests to match new async patterns
2026-05-14 16:00:54 +01:00
..
conftest.py Knowledge core processing updated for embeddings interface change (#681) 2026-03-10 13:28:16 +00:00
test_cassandra_config_integration.py Recent fixes -> release/v2.4 (#891) 2026-05-08 19:48:12 +01:00
test_cassandra_storage_logic.py Structure data mvp (#452) 2025-08-07 20:47:20 +01:00
test_doc_embeddings_milvus_storage.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_doc_embeddings_pinecone_storage.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_doc_embeddings_qdrant_storage.py Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
test_graph_embeddings_milvus_storage.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_graph_embeddings_pinecone_storage.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_graph_embeddings_qdrant_storage.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_memgraph_workspace_collection_isolation.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_neo4j_workspace_collection_isolation.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_row_embeddings_qdrant_storage.py Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
test_rows_cassandra_storage.py Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
test_triples_cassandra_storage.py Make all Cassandra and Qdrant I/O async-safe with proper concurrency controls (#916) 2026-05-14 16:00:54 +01:00
test_triples_falkordb_storage.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_triples_memgraph_storage.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00
test_triples_neo4j_storage.py feat: workspace-based multi-tenancy, replacing user as tenancy axis (#840) 2026-04-21 23:23:01 +01:00