mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
Extract memory limit into constant for easier maintenance
- Added MEMORY_LIMIT constant set to '40 MB' at module level - Replaced all hardcoded '40 MB' strings in test decorators with MEMORY_LIMIT - Makes it easier to update the memory limit in one place
This commit is contained in:
parent
a03fbd5188
commit
a05812abf2
1 changed files with 8 additions and 5 deletions
|
|
@ -28,9 +28,12 @@ from tests.load_tests.memory_leak_utils import (
|
|||
test_router, # noqa: F401 # pytest fixture used via dependency injection
|
||||
)
|
||||
|
||||
# Memory limit for all linear memory growth tests
|
||||
MEMORY_LIMIT = "40 MB"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.limit_leaks("40 MB")
|
||||
@pytest.mark.limit_leaks(MEMORY_LIMIT)
|
||||
@pytest.mark.no_parallel # Must run sequentially - measures process memory
|
||||
async def test_memory_baseline_1k(test_router, limit_memory):
|
||||
"""
|
||||
|
|
@ -47,7 +50,7 @@ async def test_memory_baseline_1k(test_router, limit_memory):
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.limit_leaks("40 MB")
|
||||
@pytest.mark.limit_leaks(MEMORY_LIMIT)
|
||||
@pytest.mark.no_parallel # Must run sequentially - measures process memory
|
||||
async def test_memory_baseline_2k(test_router, limit_memory):
|
||||
"""
|
||||
|
|
@ -64,7 +67,7 @@ async def test_memory_baseline_2k(test_router, limit_memory):
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.limit_leaks("40 MB")
|
||||
@pytest.mark.limit_leaks(MEMORY_LIMIT)
|
||||
@pytest.mark.no_parallel # Must run sequentially - measures process memory
|
||||
async def test_memory_baseline_4k(test_router, limit_memory):
|
||||
"""
|
||||
|
|
@ -83,7 +86,7 @@ async def test_memory_baseline_4k(test_router, limit_memory):
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.limit_leaks("40 MB")
|
||||
@pytest.mark.limit_leaks(MEMORY_LIMIT)
|
||||
@pytest.mark.no_parallel # Must run sequentially - measures process memory
|
||||
async def test_memory_baseline_10k(test_router, limit_memory):
|
||||
"""
|
||||
|
|
@ -101,7 +104,7 @@ async def test_memory_baseline_10k(test_router, limit_memory):
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.limit_leaks("40 MB")
|
||||
@pytest.mark.limit_leaks(MEMORY_LIMIT)
|
||||
@pytest.mark.no_parallel # Must run sequentially - measures process memory
|
||||
async def test_memory_baseline_30k(test_router, limit_memory):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue