From 37148daecfa50ac2f9ccdaa61041873461b102f6 Mon Sep 17 00:00:00 2001 From: Trayan Azarov Date: Mon, 19 Feb 2024 12:43:35 +0200 Subject: [PATCH] fix: fixed failing test due to max_batch_size exceeded with static payload size --- chromadb/test/test_api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chromadb/test/test_api.py b/chromadb/test/test_api.py index 5e72cf0449d..82eeaef219a 100644 --- a/chromadb/test/test_api.py +++ b/chromadb/test/test_api.py @@ -1505,13 +1505,13 @@ def test_optimize(api): api.reset() collection = api.create_collection("test_optimize") collection.add( - embeddings=[[0.1, 0.1, 0.1] for _ in range(10000)], - ids=[f"id{i}" for i in range(10000)], + embeddings=[[0.1, 0.1, 0.1] for _ in range(api.max_batch_size)], + ids=[f"id{i}" for i in range(api.max_batch_size)], ) output = api.optimize() if api.get_settings().is_persistent: assert output["storage_reduction"] > 0 - assert 10000 > output["wal_entries_purged"] > 0 + assert api.max_batch_size > output["wal_entries_purged"] > 0 if not isinstance(api, FastAPI): with api._sysdb.tx() as cur: cur.execute("SELECT count(*) FROM main.embeddings_queue")