Skip to content

Commit

Permalink
[mod] updated cache config for testing lru cache
Browse files Browse the repository at this point in the history
Signed-off-by: Anurag Wagh <[email protected]>
  • Loading branch information
a9raag committed Aug 16, 2023
1 parent f1a3633 commit d650109
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tests/unit_tests/eviction/test_distributed_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_lru_cache(self):
data_manager = manager_factory("redis,faiss",
eviction_manager="redis",
scalar_params={"url": self.url,
"maxmemory": "2mb",
"maxmemory": "1800kb",
"policy": "allkeys-lru"
},
vector_params={"dimension": onnx.dimension},
Expand All @@ -66,7 +66,7 @@ def test_lru_cache(self):
questions = []
answers = []
idx_list = []
for i in range(100):
for i in range(50):
idx_list.append(i)
questions.append(f'This is a question_{i}')
answers.append(f'This is an answer_{i}')
Expand All @@ -78,13 +78,8 @@ def test_lru_cache(self):
answer=answer,
embedding_data=embedding
)
for i in range(int(idx * 0.1)):
search_data = data_manager.search(embedding, top_k=1)
for res in search_data:
data_manager.get_scalar_data(res)

self.assertNotEquals(data_manager.s.count(), len(idx_list))
self.assertEqual(data_manager.get_scalar_data((0.0, 1)), None)

def test_noeviction_policy(self):
onnx = Onnx()
Expand Down

0 comments on commit d650109

Please sign in to comment.