Skip to content

./scripts/unit-tests.sh failing on test_qdrant.py #3293

@mattf

Description

@mattf

🤔 What is the technical debt you think should be addressed?

$ date; git pull; git status
Sun Aug 31 07:53:35 AM EDT 2025
Already up to date.
On branch main
Your branch is up to date with 'upstream/main'.
$ ./scripts/unit-tests.sh 
.../llama-stack/.venv/bin/python3
      Built llama-stack @ file://.../llama-stack
Uninstalled 2 packages in 27ms
Installed 3 packages in 32ms
========================================= test session starts ==========================================
platform linux -- Python 3.12.11, pytest-8.4.1, pluggy-1.6.0 -- .../llama-stack/.venv/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.12.11', 'Platform': 'Linux-6.15.7-200.fc42.x86_64-x86_64-with-glibc2.41', 'Packages': {'pytest': '8.4.1', 'pluggy': '1.6.0'}, 'Plugins': {'html': '4.1.1', 'anyio': '4.9.0', 'timeout': '2.4.0', 'cov': '6.2.1', 'asyncio': '1.1.0', 'nbval': '0.11.0', 'socket': '0.7.0', 'json-report': '1.5.0', 'metadata': '3.1.1'}}
rootdir: .../llama-stack
configfile: pyproject.toml
plugins: html-4.1.1, anyio-4.9.0, timeout-2.4.0, cov-6.2.1, asyncio-1.1.0, nbval-0.11.0, socket-0.7.0, json-report-1.5.0, metadata-3.1.1
asyncio: mode=Mode.AUTO, asyncio_default_fixture_loop_scope=None, asyncio_default_test_loop_scope=function
collected 678 items                                                                                    
...
================================================ ERRORS ================================================
__________________ ERROR at setup of test_qdrant_adapter_returns_expected_chunks[2-2] __________________

qdrant_config = QdrantVectorIOConfig(path='/tmp/pytest-of-matt/pytest-203/test_qdrant_adapter_returns_ex0/qdrant.db', kvstore=SqliteKVStoreConfig(namespace=None, type='sqlite', db_path='/home/matt/.llama/runtime/kvstore.db'))
mock_vector_db_store = <MagicMock spec='VectorDBStore' id='140019965986816'>
mock_api_service = <MagicMock spec='Inference' id='140019965990368'>
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>

    @pytest.fixture
    async def qdrant_adapter(qdrant_config, mock_vector_db_store, mock_api_service, loop) -> QdrantVectorIOAdapter:
        adapter = QdrantVectorIOAdapter(config=qdrant_config, inference_api=mock_api_service, files_api=None)
        adapter.vector_db_store = mock_vector_db_store
>       await adapter.initialize()

tests/unit/providers/vector_io/test_qdrant.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
llama_stack/providers/utils/telemetry/trace_protocol.py:101: in async_wrapper
    result = await method(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <llama_stack.providers.remote.vector_io.qdrant.qdrant.QdrantVectorIOAdapter object at 0x7f58f041d8e0>

    async def initialize(self) -> None:
        client_config = self.config.model_dump(exclude_none=True, exclude={"kvstore"})
        self.client = AsyncQdrantClient(**client_config)
        self.kvstore = await kvstore_impl(self.config.kvstore)
    
        start_key = VECTOR_DBS_PREFIX
        end_key = f"{VECTOR_DBS_PREFIX}\xff"
        stored_vector_dbs = await self.kvstore.values_in_range(start_key, end_key)
    
        for vector_db_data in stored_vector_dbs:
>           vector_db = VectorDB.model_validate_json(vector_db_data)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           pydantic_core._pydantic_core.ValidationError: 1 validation error for VectorDB
E           provider_id
E             Field required [type=missing, input_value={'identifier': 'test-vect...bedding_dimension': 384}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.11/v/missing

llama_stack/providers/remote/vector_io/qdrant/qdrant.py:181: ValidationError
________________ ERROR at setup of test_qdrant_adapter_returns_expected_chunks[100-60] _________________

qdrant_config = QdrantVectorIOConfig(path='/tmp/pytest-of-matt/pytest-203/test_qdrant_adapter_returns_ex1/qdrant.db', kvstore=SqliteKVStoreConfig(namespace=None, type='sqlite', db_path='/home/matt/.llama/runtime/kvstore.db'))
mock_vector_db_store = <MagicMock spec='VectorDBStore' id='140019965996128'>
mock_api_service = <MagicMock spec='Inference' id='140023187045600'>
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>

    @pytest.fixture
    async def qdrant_adapter(qdrant_config, mock_vector_db_store, mock_api_service, loop) -> QdrantVectorIOAdapter:
        adapter = QdrantVectorIOAdapter(config=qdrant_config, inference_api=mock_api_service, files_api=None)
        adapter.vector_db_store = mock_vector_db_store
>       await adapter.initialize()

tests/unit/providers/vector_io/test_qdrant.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
llama_stack/providers/utils/telemetry/trace_protocol.py:101: in async_wrapper
    result = await method(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <llama_stack.providers.remote.vector_io.qdrant.qdrant.QdrantVectorIOAdapter object at 0x7f59b052cbc0>

    async def initialize(self) -> None:
        client_config = self.config.model_dump(exclude_none=True, exclude={"kvstore"})
        self.client = AsyncQdrantClient(**client_config)
        self.kvstore = await kvstore_impl(self.config.kvstore)
    
        start_key = VECTOR_DBS_PREFIX
        end_key = f"{VECTOR_DBS_PREFIX}\xff"
        stored_vector_dbs = await self.kvstore.values_in_range(start_key, end_key)
    
        for vector_db_data in stored_vector_dbs:
>           vector_db = VectorDB.model_validate_json(vector_db_data)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           pydantic_core._pydantic_core.ValidationError: 1 validation error for VectorDB
E           provider_id
E             Field required [type=missing, input_value={'identifier': 'test-vect...bedding_dimension': 384}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.11/v/missing

llama_stack/providers/remote/vector_io/qdrant/qdrant.py:181: ValidationError
___________________ ERROR at setup of test_qdrant_register_and_unregister_vector_db ____________________

qdrant_config = QdrantVectorIOConfig(path='/tmp/pytest-of-matt/pytest-203/test_qdrant_register_and_unreg0/qdrant.db', kvstore=SqliteKVStoreConfig(namespace=None, type='sqlite', db_path='/home/matt/.llama/runtime/kvstore.db'))
mock_vector_db_store = <MagicMock spec='VectorDBStore' id='140019964704816'>
mock_api_service = <MagicMock spec='Inference' id='140019964691760'>
loop = <_UnixSelectorEventLoop running=False closed=False debug=False>

    @pytest.fixture
    async def qdrant_adapter(qdrant_config, mock_vector_db_store, mock_api_service, loop) -> QdrantVectorIOAdapter:
        adapter = QdrantVectorIOAdapter(config=qdrant_config, inference_api=mock_api_service, files_api=None)
        adapter.vector_db_store = mock_vector_db_store
>       await adapter.initialize()

tests/unit/providers/vector_io/test_qdrant.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
llama_stack/providers/utils/telemetry/trace_protocol.py:101: in async_wrapper
    result = await method(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <llama_stack.providers.remote.vector_io.qdrant.qdrant.QdrantVectorIOAdapter object at 0x7f59704771d0>

    async def initialize(self) -> None:
        client_config = self.config.model_dump(exclude_none=True, exclude={"kvstore"})
        self.client = AsyncQdrantClient(**client_config)
        self.kvstore = await kvstore_impl(self.config.kvstore)
    
        start_key = VECTOR_DBS_PREFIX
        end_key = f"{VECTOR_DBS_PREFIX}\xff"
        stored_vector_dbs = await self.kvstore.values_in_range(start_key, end_key)
    
        for vector_db_data in stored_vector_dbs:
>           vector_db = VectorDB.model_validate_json(vector_db_data)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           pydantic_core._pydantic_core.ValidationError: 1 validation error for VectorDB
E           provider_id
E             Field required [type=missing, input_value={'identifier': 'test-vect...bedding_dimension': 384}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.11/v/missing

llama_stack/providers/remote/vector_io/qdrant/qdrant.py:181: ValidationError
...
======================================= short test summary info ========================================
ERROR tests/unit/providers/vector_io/test_qdrant.py::test_qdrant_adapter_returns_expected_chunks[2-2] - pydantic_core._pydantic_core.ValidationError: 1 validation error for VectorDB
ERROR tests/unit/providers/vector_io/test_qdrant.py::test_qdrant_adapter_returns_expected_chunks[100-60] - pydantic_core._pydantic_core.ValidationError: 1 validation error for VectorDB
ERROR tests/unit/providers/vector_io/test_qdrant.py::test_qdrant_register_and_unregister_vector_db - pydantic_core._pydantic_core.ValidationError: 1 validation error for VectorDB
============================= 675 passed, 204 warnings, 3 errors in 55.53s =============================

💡 What is the benefit of addressing this technical debt?

passing test suite

Other thoughts

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions