From e18fb87f6942249b8db04de730aad9d4d7b70b60 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Tue, 22 Sep 2026 18:24:35 -0700 Subject: [PATCH] test(e2e): shorten the new helper docstrings --- tests/e2e/e2e_http.py | 11 ++--------- tests/e2e/llm_translation/test_ocr_rust_e2e.py | 5 ----- tests/e2e/router/reliability_support.py | 9 ++------- tests/e2e/router/test_reliability_support.py | 3 +-- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/tests/e2e/e2e_http.py b/tests/e2e/e2e_http.py index 237960e4fc3..74ed596beb6 100644 --- a/tests/e2e/e2e_http.py +++ b/tests/e2e/e2e_http.py @@ -356,15 +356,8 @@ def tolerate_provider_rate_limit[R: BaseModel]( attempts: int = PROVIDER_RATE_LIMIT_ATTEMPTS, sleep: Callable[[float], None] = time.sleep, ) -> Result[R]: - """Bounded, opt-in retry of one call the PROVIDER throttled, for a deployment - with no fallback group whose provider key is shared with the suites that run - alongside this one. The transport never retries a 429 (see request_with_retry), - and this helper only absorbs the 429s the proxy relayed from the provider, which - litellm's exception mapping prefixes with its exception class; the proxy's own - limiter and budget 429s never carry that prefix and come back untouched, so - every assertion on those still sees them. The wait honors Retry-After when the - provider sent one and backs off geometrically otherwise, and every retry prints - so the throttling stays visible in the run log instead of vanishing into green.""" + """Retry a call up to `attempts` times while the proxy relays the provider's own 429; + any other outcome, the proxy's own 429 included, comes back at once.""" for attempt in range(1, attempts): match issue(): case RateLimitedError(body=body, retry_after_seconds=retry_after) if PROVIDER_RATE_LIMIT_MARKER in body: diff --git a/tests/e2e/llm_translation/test_ocr_rust_e2e.py b/tests/e2e/llm_translation/test_ocr_rust_e2e.py index 24c98170609..2456f64d057 100644 --- a/tests/e2e/llm_translation/test_ocr_rust_e2e.py +++ b/tests/e2e/llm_translation/test_ocr_rust_e2e.py @@ -11,11 +11,6 @@ well-formed OCR document comes back. Per the e2e hard-fail contract, a case fails when no proxy answers and also fails once a request reaches it: the proxy fetches each provider's referenced secrets, so a missing credential surfaces as a live provider error rather than silent green. - -The Mistral key is shared with the suites that run alongside this one and the -deployment has no fallback group, so the OCR call tolerates a bounded number of -provider 429s the proxy relays (tolerate_provider_rate_limit); a 429 the proxy -issues itself still fails the case at once. """ from __future__ import annotations diff --git a/tests/e2e/router/reliability_support.py b/tests/e2e/router/reliability_support.py index 503d7684cc0..5984d5645d8 100644 --- a/tests/e2e/router/reliability_support.py +++ b/tests/e2e/router/reliability_support.py @@ -377,13 +377,8 @@ class _AzureAnnotatedChatBody(BaseModel): def azure_prompt_filter_skipped(resp: StreamingResponse) -> bool: - """True when Azure answered without running its prompt content filter: the body - carries ``prompt_filter_results`` whose ``content_filter_results`` are all empty, - where a filter that ran records a verdict per category (jailbreak included). - Azure does this intermittently and it says nothing about the prompt, so a test - that needs the filter's verdict sends the prompt again instead of reading a - skipped filter as a pass. A body without the field (an OpenAI completion served - by a fallback, or an error body) is not a skipped filter.""" + """True when Azure's 200 recorded no prompt-filter verdict (every `content_filter_results` + empty), so the prompt has to be sent again.""" try: annotated: Final = _AzureAnnotatedChatBody.model_validate_json(resp.body) except ValidationError: diff --git a/tests/e2e/router/test_reliability_support.py b/tests/e2e/router/test_reliability_support.py index 3399c3fab7e..fbf434f2dc2 100644 --- a/tests/e2e/router/test_reliability_support.py +++ b/tests/e2e/router/test_reliability_support.py @@ -1,5 +1,4 @@ -"""Unit tests for the reliability helpers that read provider bodies, driven with -the verbatim shapes the proxy relays; nothing here needs a proxy or a provider.""" +"""Contract tests for the helpers that read provider bodies; no proxy or provider needed.""" from __future__ import annotations