Skip to content

Commit

Permalink
fix: fixed failing test due to max_batch_size exceeded with static pa…
Browse files Browse the repository at this point in the history
…yload size
  • Loading branch information
tazarov committed Feb 19, 2024
1 parent 641fb64 commit 37148da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chromadb/test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 37148da

Please sign in to comment.