Skip to content

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

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

refactor(qdrant): use async DocumentStore mixin tests#3093
SyedShahmeerAli12 wants to merge 3 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
from haystack.document_stores.errors import DuplicateDocumentError
from haystack.document_stores.types import DuplicatePolicy
from haystack.testing.document_store import (
CountDocumentsByFilterAsyncTest,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We need to move those for the import below - they are already in haystack.testing.document_store_async in main. We need to wait for the next release then to merge this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That also explains the 6 CI failures on
test_count_unique_metadata_by_filter_async_all_documents the current mixin in
haystack.testing.document_store uses sync write_documents, which initializes a separate
in-memory client from the async one used by count_unique_metadata_by_filter_async. So the
async client sees an empty store and returns 0.

I'll update the imports to haystack.testing.document_store_async once the next haystack
release ships those changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks 👍🏽

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
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