update index batch parallel tests

This commit is contained in:
CREDO23 2026-06-17 14:59:24 +02:00
parent aca23b4731
commit a8a1f01945

View file

@ -65,10 +65,18 @@ async def test_index_calls_embed_and_chunk_via_to_thread(
"app.indexing_pipeline.cache.cached_indexing.embed_texts",
mock_embed,
)
# Bypass set_committed_value, which requires a real ORM instance (not MagicMock).
monkeypatch.setattr(
"app.indexing_pipeline.indexing_pipeline_service.attach_chunks_to_document",
MagicMock(),
pipeline,
"_load_existing_chunks",
AsyncMock(return_value=[]),
)
async def _noop_persist(_session, doc, *_args, **_kwargs):
doc.status = DocumentStatus.ready()
monkeypatch.setattr(
"app.indexing_pipeline.indexing_pipeline_service.persist_scratch_index",
_noop_persist,
)
connector_doc = make_connector_document(
@ -116,8 +124,17 @@ async def test_non_code_documents_use_hybrid_chunker(
MagicMock(side_effect=lambda texts: [[0.1] * _EMBEDDING_DIM for _ in texts]),
)
monkeypatch.setattr(
"app.indexing_pipeline.indexing_pipeline_service.attach_chunks_to_document",
MagicMock(),
pipeline,
"_load_existing_chunks",
AsyncMock(return_value=[]),
)
async def _noop_persist(_session, doc, *_args, **_kwargs):
doc.status = DocumentStatus.ready()
monkeypatch.setattr(
"app.indexing_pipeline.indexing_pipeline_service.persist_scratch_index",
_noop_persist,
)
connector_doc = make_connector_document(