test(test_parallel_request_limiter.py): fix test to handle minute changes

This commit is contained in:
Krrish Dholakia 2024-02-03 20:39:21 -08:00
parent 1155025e6a
commit 3e35041758

View file

@ -525,17 +525,12 @@ async def test_streaming_router_tpm_limit():
continue
await asyncio.sleep(5) # success is done in a separate thread
try:
await parallel_request_handler.async_pre_call_hook(
user_api_key_dict=user_api_key_dict,
cache=local_cache,
data={},
call_type="",
)
pytest.fail(f"Expected call to fail")
except Exception as e:
assert e.status_code == 429
assert (
parallel_request_handler.user_api_key_cache.get_cache(
key=request_count_api_key
)["current_tpm"]
> 0
)
@pytest.mark.asyncio