mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-03 07:23:33 +00:00
test(json_fragment_accumulator): assert the lowest of three drain peaks
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
d2237e494d
commit
84c3157308
1 changed files with 1 additions and 1 deletions
|
|
@ -216,7 +216,7 @@ def test_draining_many_concatenated_values_never_copies_the_remainder():
|
|||
value: Final = '{"text": "' + "x" * 20 + '"}'
|
||||
fragments: Final = tuple(value if index % 2 else f" {value}" for index in range(40_000))
|
||||
payload_bytes: Final = sum(len(fragment) for fragment in fragments)
|
||||
peak_bytes: Final = _drain_peak_bytes(fragments)
|
||||
peak_bytes: Final = min(_drain_peak_bytes(fragments) for _ in range(3))
|
||||
assert peak_bytes < payload_bytes // 4, (
|
||||
f"draining {len(fragments)} values allocated a peak of {peak_bytes} bytes over a {payload_bytes} byte payload, "
|
||||
"copying the remainder on every pop?"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue