Skip to content

DeleteAllAsyncTest, DeleteByFilterAsyncTest, #10919

@davidsbatista

Description

@davidsbatista

NOTES:

  • Tests should be written into haystack/testing/document_store_async.py
  • Use async def for all test methods
  • Decorate each test method with @pytest.mark.asyncio
  • Rely on an async-compatible document_store fixture (to be provided by the concrete test class in each integration)
  • Use await on all *_async() calls
  • Use write_documents_async / count_documents_async in setup steps (not the sync variants), so the full async path is exercised end-to-end
  • Open the PR to the async-mixin-tests feature branch

DeleteAllAsyncTest

Mirrors: DeleteAllTest

Test Description
test_delete_all_documents_async Write 2 docs, delete all, count is 0; write 1 new doc, count is 1
test_delete_all_documents_empty_store_async delete_all_documents_async() on empty store doesn't raise, count stays 0
test_delete_all_documents_without_recreate_index_async Skipped if recreate_index/recreate_collection param not present; else tests False variant
test_delete_all_documents_with_recreate_index_async Skipped if param not present; else tests True variant, verifies store still works after

Use inspect.signature(document_store.delete_all_documents_async) to detect recreate_index/recreate_collection parameter (same pattern as sync DeleteAllTest._delete_all_supports_recreate).

DeleteByFilterAsyncTest

Mirrors: DeleteByFilterTest

Test Description
test_delete_by_filter_async Write 3 docs, delete 2 by category filter, verify 1 remains
test_delete_by_filter_no_matches_async Filter matching nothing returns 0 deleted, store unchanged
test_delete_by_filter_advanced_filters_async AND and OR compound filter deletions in sequence

Use inspect.signature(document_store.delete_by_filter_async) to detect optional refresh parameter.

Metadata

Metadata

Assignees

Labels

P1High priority, add to the next sprint

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions