Skip to content

refactor(qdrant): use async DocumentStore mixin tests#3093

Open
SyedShahmeerAli12 wants to merge 10 commits intodeepset-ai:mainfrom
SyedShahmeerAli12:refactor/qdrant-async-mixin-tests
Open

refactor(qdrant): use async DocumentStore mixin tests#3093
SyedShahmeerAli12 wants to merge 10 commits intodeepset-ai:mainfrom
SyedShahmeerAli12:refactor/qdrant-async-mixin-tests

Conversation

@SyedShahmeerAli12
Copy link
Copy Markdown
Contributor

@SyedShahmeerAli12 SyedShahmeerAli12 commented Apr 2, 2026

Related Issues

Closes #3052

▎ What this changes

▎ Refactors integrations/qdrant/tests/test_document_store_async.py to inherit from the async
mixin classes introduced in deepset-ai/haystack#10799.

▎ - Removes 19 duplicate tests now covered by the mixins
▎ - Keeps all Qdrant-specific tests (hybrid search, sparse config, collection setup
validation, vector preservation)
▎ - Adds FilterDocumentsAsyncTest and CountDocumentsAsyncTest since Qdrant implements both
filter_documents_async and count_documents_async

@SyedShahmeerAli12 SyedShahmeerAli12 requested a review from a team as a code owner April 2, 2026 15:17
@SyedShahmeerAli12 SyedShahmeerAli12 requested review from anakin87 and removed request for a team April 2, 2026 15:17
@github-actions github-actions Bot added integration:qdrant type:documentation Improvements or additions to documentation labels Apr 2, 2026
@anakin87 anakin87 requested a review from davidsbatista April 2, 2026 15:20
Copy link
Copy Markdown
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋

Could you please fix the conflict?

@anakin87 anakin87 removed the request for review from davidsbatista April 2, 2026 15:26
@SyedShahmeerAli12 SyedShahmeerAli12 force-pushed the refactor/qdrant-async-mixin-tests branch from 09aa131 to 1028adb Compare April 2, 2026 15:28
Comment thread integrations/qdrant/tests/test_document_store_async.py Outdated
Closes deepset-ai#3052

Replaces duplicate async test implementations with the mixin classes
from haystack.testing.document_store and haystack.testing.document_store_async.

- Removes 19 tests now covered by the mixins
- Keeps all Qdrant-specific tests (hybrid search, sparse config, collection
  setup validation, vector preservation)
…clients

When using location=':memory:', QdrantClient and AsyncQdrantClient each
create a separate in-memory store, so data written via the sync client is
invisible to the async client and vice versa.

Fix by sharing the underlying .collections and .aliases dicts after the
second client is initialised, so both clients always see the same data.

This makes mixed sync/async tests (e.g. sync write_documents + async
count_unique_metadata_by_filter_async) work correctly with in-memory stores.
- Override assert_documents_are_equal to compare by ID set (Qdrant
  returns embedding vectors on all docs and doesn't guarantee order)
- Override test_write_documents_async (base raises NotImplementedError
  by design, requires store-specific implementation)
- Override test_count_not_empty_async to add missing self parameter
  (bug in haystack mixin causes fixture injection to fail)
@SyedShahmeerAli12 SyedShahmeerAli12 force-pushed the refactor/qdrant-async-mixin-tests branch from faa8e99 to 6ac1294 Compare April 7, 2026 10:15
@github-actions
Copy link
Copy Markdown
Contributor

Coverage report (qdrant)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  integrations/qdrant/src/haystack_integrations/document_stores/qdrant
  document_store.py 275-277, 302-304
Project Total  

This report was generated by python-coverage-comment-action

Copy link
Copy Markdown
Contributor

@davidsbatista davidsbatista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks once again for the contribution; Did some adjustments

@davidsbatista davidsbatista requested a review from anakin87 April 21, 2026 12:41
@davidsbatista
Copy link
Copy Markdown
Contributor

Failing due to using sync methods in async Mixin tests:

deepset-ai/haystack#11173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:qdrant type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use async DocumentStore mixin tests in Qdrant

3 participants