fix: test

This commit is contained in:
Javier Martinez
2026-07-14 13:46:31 +02:00
parent 00a5633509
commit 2bbcb1df14
2 changed files with 7 additions and 11 deletions

View File

@@ -73,15 +73,15 @@ class QdrantClientBuilder:
config = dict(config)
config["path"] = str(resolve_data_path(config["path"]))
# This is a workaround to allow to execute tests/local qdrant
# when we want to support sync/async client.
# To allow, remove .lock from the db_dir
db_dir = config["path"]
# Local Qdrant uses one lock file for sync and async clients.
# Remove it between client construction using the resolved path.
client = QdrantClient(**config)
QdrantClientBuilder.clean_lock(settings)
QdrantClientBuilder.clean_lock(db_dir=db_dir)
aclient = AsyncQdrantClient(**config)
QdrantClientBuilder.clean_lock(settings)
QdrantClientBuilder.clean_lock(db_dir=db_dir)
else:
client = QdrantClient(**config)
@@ -97,11 +97,7 @@ class QdrantClientBuilder:
return config.get("path") is not None
@staticmethod
def clean_lock(settings: Settings) -> None:
db_dir = settings.qdrant.path
if db_dir is None:
return
def clean_lock(db_dir: str) -> None:
lock_file = os.path.join(db_dir, ".lock")
if os.path.exists(lock_file):
os.remove(lock_file)

View File

@@ -20,7 +20,7 @@ scheduler:
# Tests run local ingestion and local retrieval in the same process. This
# mode reuses the already-open local Qdrant handle instead of opening a
# second sync/async client pair against the same on-disk database.
mode: celery
mode: local
docling:
mode: api