mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 19:24:27 +00:00
fix(test_parallel_request_limiter): increase time limit for waiting for success logging event to happen
This commit is contained in:
parent
85cbe5fb4c
commit
c91ab81fde
3 changed files with 11 additions and 3 deletions
|
@ -17,7 +17,12 @@ class MaxParallelRequestsHandler(CustomLogger):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def print_verbose(self, print_statement):
|
def print_verbose(self, print_statement):
|
||||||
verbose_proxy_logger.debug(print_statement)
|
try:
|
||||||
|
verbose_proxy_logger.debug(print_statement)
|
||||||
|
if litellm.set_verbose:
|
||||||
|
print(print_statement) # noqa
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
async def async_pre_call_hook(
|
async def async_pre_call_hook(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -21,6 +21,7 @@ from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
|
||||||
def print_verbose(print_statement):
|
def print_verbose(print_statement):
|
||||||
|
verbose_proxy_logger.debug(print_statement)
|
||||||
if litellm.set_verbose:
|
if litellm.set_verbose:
|
||||||
print(f"LiteLLM Proxy: {print_statement}") # noqa
|
print(f"LiteLLM Proxy: {print_statement}") # noqa
|
||||||
|
|
||||||
|
@ -96,6 +97,7 @@ class ProxyLogging:
|
||||||
2. /embeddings
|
2. /embeddings
|
||||||
3. /image/generation
|
3. /image/generation
|
||||||
"""
|
"""
|
||||||
|
print_verbose(f"Inside Proxy Logging Pre-call hook!")
|
||||||
### ALERTING ###
|
### ALERTING ###
|
||||||
asyncio.create_task(self.response_taking_too_long(request_data=data))
|
asyncio.create_task(self.response_taking_too_long(request_data=data))
|
||||||
|
|
||||||
|
@ -1035,7 +1037,7 @@ async def send_email(sender_name, sender_email, receiver_email, subject, html):
|
||||||
print_verbose(f"SMTP Connection Init")
|
print_verbose(f"SMTP Connection Init")
|
||||||
# Establish a secure connection with the SMTP server
|
# Establish a secure connection with the SMTP server
|
||||||
with smtplib.SMTP(smtp_host, smtp_port) as server:
|
with smtplib.SMTP(smtp_host, smtp_port) as server:
|
||||||
if os.getenv("SMTP_TLS", 'True') != "False":
|
if os.getenv("SMTP_TLS", "True") != "False":
|
||||||
server.starttls()
|
server.starttls()
|
||||||
|
|
||||||
# Login to your email account
|
# Login to your email account
|
||||||
|
|
|
@ -456,6 +456,7 @@ async def test_streaming_router_call():
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test_streaming_router_tpm_limit():
|
async def test_streaming_router_tpm_limit():
|
||||||
|
litellm.set_verbose = True
|
||||||
model_list = [
|
model_list = [
|
||||||
{
|
{
|
||||||
"model_name": "azure-model",
|
"model_name": "azure-model",
|
||||||
|
@ -520,7 +521,7 @@ async def test_streaming_router_tpm_limit():
|
||||||
)
|
)
|
||||||
async for chunk in response:
|
async for chunk in response:
|
||||||
continue
|
continue
|
||||||
await asyncio.sleep(1) # success is done in a separate thread
|
await asyncio.sleep(5) # success is done in a separate thread
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await parallel_request_handler.async_pre_call_hook(
|
await parallel_request_handler.async_pre_call_hook(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue