From af71cf489619028822c2beffebf1369956a24620 Mon Sep 17 00:00:00 2001 From: phernandez Date: Sat, 7 Mar 2026 13:54:58 -0600 Subject: [PATCH] fix(test): clear search_vector_chunks before embedding backfill test Test was polluted by other tests leaving rows in search_vector_chunks, causing _needs_semantic_embedding_backfill to return False. Co-Authored-By: Claude Opus 4.6 Signed-off-by: phernandez --- tests/services/test_initialization.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/services/test_initialization.py b/tests/services/test_initialization.py index 29f8c200..7ca22135 100644 --- a/tests/services/test_initialization.py +++ b/tests/services/test_initialization.py @@ -393,6 +393,10 @@ async def test_needs_semantic_embedding_backfill_true_when_entities_exist_no_emb } ) + # Clear any embeddings left by other tests in the shared DB + async with db.scoped_session(session_maker) as session: + await session.execute(db.text("DELETE FROM search_vector_chunks")) + app_config.semantic_search_enabled = True result = await db._needs_semantic_embedding_backfill(app_config, session_maker) # pyright: ignore [reportPrivateUsage] assert result is True