forked from phoenix/litellm-mirror
test: increase time before checking budget reset - avoid deadlocking
This commit is contained in:
parent
0273410310
commit
b9854a99d2
4 changed files with 5 additions and 4 deletions
|
@ -10,6 +10,7 @@
|
||||||
import os, openai, sys, json, inspect, uuid, datetime, threading
|
import os, openai, sys, json, inspect, uuid, datetime, threading
|
||||||
from typing import Any, Literal, Union
|
from typing import Any, Literal, Union
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
import dotenv, traceback, random, asyncio, time, contextvars
|
import dotenv, traceback, random, asyncio, time, contextvars
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
import httpx
|
import httpx
|
||||||
|
|
|
@ -42,8 +42,8 @@ litellm_settings:
|
||||||
request_timeout: 600
|
request_timeout: 600
|
||||||
general_settings:
|
general_settings:
|
||||||
master_key: sk-1234 # [OPTIONAL] Only use this if you to require all calls to contain this key (Authorization: Bearer sk-1234)
|
master_key: sk-1234 # [OPTIONAL] Only use this if you to require all calls to contain this key (Authorization: Bearer sk-1234)
|
||||||
proxy_budget_rescheduler_min_time: 10
|
proxy_budget_rescheduler_min_time: 60
|
||||||
proxy_budget_rescheduler_max_time: 12
|
proxy_budget_rescheduler_max_time: 64
|
||||||
# database_url: "postgresql://<user>:<password>@<host>:<port>/<dbname>" # [OPTIONAL] use for token-based auth to proxy
|
# database_url: "postgresql://<user>:<password>@<host>:<port>/<dbname>" # [OPTIONAL] use for token-based auth to proxy
|
||||||
|
|
||||||
environment_variables:
|
environment_variables:
|
||||||
|
|
|
@ -461,8 +461,8 @@ async def test_key_with_budgets():
|
||||||
reset_at_init_value = key_info["info"]["budget_reset_at"]
|
reset_at_init_value = key_info["info"]["budget_reset_at"]
|
||||||
reset_at_new_value = None
|
reset_at_new_value = None
|
||||||
i = 0
|
i = 0
|
||||||
await asyncio.sleep(20)
|
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
|
await asyncio.sleep(70)
|
||||||
key_info = await retry_request(
|
key_info = await retry_request(
|
||||||
get_key_info, session=session, get_key=key, call_key=key
|
get_key_info, session=session, get_key=key, call_key=key
|
||||||
)
|
)
|
||||||
|
|
|
@ -126,7 +126,7 @@ async def test_users_budgets_reset():
|
||||||
i = 0
|
i = 0
|
||||||
reset_at_new_value = None
|
reset_at_new_value = None
|
||||||
while i < 3:
|
while i < 3:
|
||||||
await asyncio.sleep(15)
|
await asyncio.sleep(70)
|
||||||
user_info = await get_user_info(
|
user_info = await get_user_info(
|
||||||
session=session, get_user=get_user, call_user=key
|
session=session, get_user=get_user, call_user=key
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue