fix(test+rag): clean chroma cache pre-test + add INVESTIGATE stderr for RAG init
This commit is contained in:
@@ -16,7 +16,25 @@ from src import api_hook_client
|
||||
def test_phase4_final_verify(live_gui, live_gui_workspace):
|
||||
client = api_hook_client.ApiHookClient()
|
||||
assert client.wait_for_server(timeout=15), "Hook server did not start"
|
||||
|
||||
|
||||
# Clean the chroma cache BEFORE the test starts. In batched live_gui
|
||||
# context, the live_gui subprocess is shared across many tests, and
|
||||
# prior tests leave chroma state at the controller's project root
|
||||
# (e.g. C:\projects\manual_slop\tests\artifacts\.slop_cache\chroma_test_*).
|
||||
# The dim-mismatch rmtree in rag_engine._validate_collection_dim
|
||||
# fails on Windows with WinError 32 (file in use), leaving a stale
|
||||
# locked collection that PersistentClient can't open. Wipe the
|
||||
# relevant cache dirs proactively so the test starts clean.
|
||||
_workspace_root = str(live_gui_workspace.parent if live_gui_workspace else Path.cwd())
|
||||
stale_path = Path(_workspace_root) / ".slop_cache"
|
||||
if stale_path.exists():
|
||||
for col_dir in stale_path.iterdir():
|
||||
if col_dir.is_dir() and col_dir.name.startswith("chroma_"):
|
||||
try:
|
||||
shutil.rmtree(col_dir)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 1. Setup mock project data
|
||||
workspace_dir = live_gui_workspace
|
||||
workspace_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user