mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(fix) test_normal_router_tpm_limit
This commit is contained in:
parent
bdb9fc8f20
commit
adb67da026
1 changed files with 6 additions and 0 deletions
|
@ -306,6 +306,10 @@ async def test_normal_router_call():
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_normal_router_tpm_limit():
|
async def test_normal_router_tpm_limit():
|
||||||
|
from litellm._logging import verbose_proxy_logger
|
||||||
|
import logging
|
||||||
|
|
||||||
|
verbose_proxy_logger.setLevel(level=logging.DEBUG)
|
||||||
model_list = [
|
model_list = [
|
||||||
{
|
{
|
||||||
"model_name": "azure-model",
|
"model_name": "azure-model",
|
||||||
|
@ -353,6 +357,7 @@ async def test_normal_router_tpm_limit():
|
||||||
current_minute = datetime.now().strftime("%M")
|
current_minute = datetime.now().strftime("%M")
|
||||||
precise_minute = f"{current_date}-{current_hour}-{current_minute}"
|
precise_minute = f"{current_date}-{current_hour}-{current_minute}"
|
||||||
request_count_api_key = f"{_api_key}::{precise_minute}::request_count"
|
request_count_api_key = f"{_api_key}::{precise_minute}::request_count"
|
||||||
|
print("Test: Checking current_requests for precise_minute=", precise_minute)
|
||||||
|
|
||||||
assert (
|
assert (
|
||||||
parallel_request_handler.user_api_key_cache.get_cache(
|
parallel_request_handler.user_api_key_cache.get_cache(
|
||||||
|
@ -366,6 +371,7 @@ async def test_normal_router_tpm_limit():
|
||||||
model="azure-model",
|
model="azure-model",
|
||||||
messages=[{"role": "user", "content": "Write me a paragraph on the moon"}],
|
messages=[{"role": "user", "content": "Write me a paragraph on the moon"}],
|
||||||
metadata={"user_api_key": _api_key},
|
metadata={"user_api_key": _api_key},
|
||||||
|
mock_response="hello",
|
||||||
)
|
)
|
||||||
await asyncio.sleep(1) # success is done in a separate thread
|
await asyncio.sleep(1) # success is done in a separate thread
|
||||||
print(f"response: {response}")
|
print(f"response: {response}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue