(testing) Router add testing coverage (#6253)

* test: add more router code coverage

* test: additional router testing coverage

* fix: fix linting error

* test: fix tests for ci/cd

* test: fix test

* test: handle flaky tests

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
This commit is contained in:
Ishaan Jaff 2024-10-16 20:02:27 +05:30 committed by GitHub
parent b72a47d092
commit dee6de0105
7 changed files with 706 additions and 106 deletions

View file

@ -148,13 +148,17 @@ def _set_cooldown_deployments(
exception_status: Union[str, int],
deployment: Optional[str] = None,
time_to_cooldown: Optional[float] = None,
):
) -> bool:
"""
Add a model to the list of models being cooled down for that minute, if it exceeds the allowed fails / minute
or
the exception is not one that should be immediately retried (e.g. 401)
Returns:
- True if the deployment should be put in cooldown
- False if the deployment should not be put in cooldown
"""
if (
_should_run_cooldown_logic(
@ -163,7 +167,7 @@ def _set_cooldown_deployments(
is False
or deployment is None
):
return
return False
exception_status_int = cast_exception_status_to_int(exception_status)
@ -191,6 +195,8 @@ def _set_cooldown_deployments(
cooldown_time=cooldown_time,
)
)
return True
return False
async def _async_get_cooldown_deployments(