fix: fix test to specify allowed_fails

This commit is contained in:
Krrish Dholakia 2024-08-05 21:39:45 -07:00
parent 0fd8e5b7be
commit fdb47e5479
2 changed files with 17 additions and 6 deletions

View file

@ -321,7 +321,10 @@ class Router:
[] []
) # initialize an empty list - to allow _add_deployment and delete_deployment to work ) # initialize an empty list - to allow _add_deployment and delete_deployment to work
self.allowed_fails = allowed_fails or litellm.allowed_fails if allowed_fails is not None:
self.allowed_fails = allowed_fails
else:
self.allowed_fails = litellm.allowed_fails
self.cooldown_time = cooldown_time or 60 self.cooldown_time = cooldown_time or 60
self.disable_cooldowns = disable_cooldowns self.disable_cooldowns = disable_cooldowns
self.failed_calls = ( self.failed_calls = (

View file

@ -1,17 +1,23 @@
#### What this tests #### #### What this tests ####
# This tests calling batch_completions by running 100 messages together # This tests calling batch_completions by running 100 messages together
import sys, os, time import asyncio
import traceback, asyncio import os
import sys
import time
import traceback
import pytest import pytest
sys.path.insert( sys.path.insert(
0, os.path.abspath("../..") 0, os.path.abspath("../..")
) # Adds the parent directory to the system path ) # Adds the parent directory to the system path
import concurrent
from dotenv import load_dotenv
import litellm import litellm
from litellm import Router from litellm import Router
import concurrent
from dotenv import load_dotenv
load_dotenv() load_dotenv()
@ -45,7 +51,8 @@ kwargs = {
def test_multiple_deployments_sync(): def test_multiple_deployments_sync():
import concurrent, time import concurrent
import time
litellm.set_verbose = False litellm.set_verbose = False
results = [] results = []
@ -161,6 +168,7 @@ async def test_cooldown_same_model_name(sync_mode):
routing_strategy="simple-shuffle", routing_strategy="simple-shuffle",
set_verbose=True, set_verbose=True,
num_retries=3, num_retries=3,
allowed_fails=0,
) # type: ignore ) # type: ignore
if sync_mode: if sync_mode: