Skip to content

Commit

Permalink
Feedback changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bsuryadevara committed Oct 12, 2023
1 parent cd52a5f commit 5ce3402
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
2 changes: 1 addition & 1 deletion morpheus/service/milvus_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class MilvusClient(pymilvus.MilvusClient):
Name of the Milvus database.
token : str
Token for authentication.
**kwargs : dict
**kwargs : dict[str, typing.Any]
Additional keyword arguments for the MilvusClient constructor.
"""

Expand Down
23 changes: 0 additions & 23 deletions tests/test_milvus_vector_db_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import concurrent.futures
import json
import os
import time

import numpy as np
import pytest
Expand Down Expand Up @@ -427,25 +426,3 @@ def test_get_collection_lock():
lock = MilvusVectorDBService.get_collection_lock(collection_name)
assert "lock" == type(lock).__name__
assert collection_name in MilvusVectorDBService._collection_locks


def test_cleanup_collection_locks():

collection_name_1 = "test_cleanup_collection_lock"
MilvusVectorDBService.get_collection_lock(collection_name_1)
assert len(MilvusVectorDBService._collection_locks) == 1

MilvusVectorDBService._last_cleanup_time = time.time() - 400
collection_name_2 = "test_cleanup_collection_lock2"
MilvusVectorDBService._collection_locks[collection_name_1]["last_used"] = time.time() - 400
MilvusVectorDBService.get_collection_lock(collection_name_2)

assert len(MilvusVectorDBService._collection_locks) == 2

MilvusVectorDBService._last_cleanup_time = time.time() - 601
MilvusVectorDBService._collection_locks[collection_name_1]["last_used"] = time.time() - 600
MilvusVectorDBService._collection_locks[collection_name_2]["last_used"] = time.time() - 600
collection_name = "test_cleanup_collection_lock3"
MilvusVectorDBService.get_collection_lock(collection_name)

assert len(MilvusVectorDBService._collection_locks) == 1

0 comments on commit 5ce3402

Please sign in to comment.