mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
test(integration): shape the round 4 chaos cells after the gauntlet repros
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
08c3bf6192
commit
dfec7c2605
2 changed files with 12 additions and 11 deletions
|
|
@ -116,13 +116,14 @@ def owned_proxy_process(
|
|||
(
|
||||
[
|
||||
sys.executable,
|
||||
"-m",
|
||||
"hypercorn",
|
||||
"litellm.proxy.proxy_server:app",
|
||||
"--bind",
|
||||
f"127.0.0.1:{port}",
|
||||
"--graceful-timeout",
|
||||
str(graceful_shutdown_seconds),
|
||||
"litellm/proxy/proxy_cli.py",
|
||||
"--run_hypercorn",
|
||||
"--config",
|
||||
str(config),
|
||||
"--host",
|
||||
"127.0.0.1",
|
||||
"--port",
|
||||
str(port),
|
||||
]
|
||||
if asgi_server == "hypercorn"
|
||||
else [
|
||||
|
|
|
|||
|
|
@ -384,7 +384,9 @@ async def test_passthrough_abort_after_budget_with_disconnect_during_hook_logs_o
|
|||
candidate: Final = owned.gateway
|
||||
received: Final = bytearray()
|
||||
async with httpx.AsyncClient(
|
||||
base_url=str(candidate.client.base_url), timeout=httpx.Timeout(10, connect=5), trust_env=False
|
||||
base_url=str(candidate.client.base_url),
|
||||
timeout=httpx.Timeout(10, read=1, connect=5),
|
||||
trust_env=False,
|
||||
) as client:
|
||||
try:
|
||||
async with client.stream(
|
||||
|
|
@ -397,7 +399,7 @@ async def test_passthrough_abort_after_budget_with_disconnect_during_hook_logs_o
|
|||
call_id: Final = response.headers["x-litellm-call-id"]
|
||||
async for chunk in response.aiter_bytes():
|
||||
received.extend(chunk)
|
||||
except httpx.TransportError:
|
||||
except (httpx.TransportError, httpx.TimeoutException):
|
||||
pass
|
||||
assert bytes(received) == b"x" * 4608, len(received)
|
||||
await asyncio.to_thread(eventually, lambda: (tmp_path / "hook_started").exists(), bool, 30)
|
||||
|
|
@ -415,8 +417,6 @@ async def test_passthrough_error_report_survives_sigterm_after_full_response(
|
|||
) -> None:
|
||||
"""The graceful window cancels the request task, but the report task is shielded
|
||||
and the lifespan shutdown waits for it before the spend flushes."""
|
||||
if asgi_server == "hypercorn":
|
||||
pytest.skip("BUG: a litellm proxy under hypercorn does not exit within 60s of SIGTERM here, drain unreachable")
|
||||
|
||||
def respond(request: Request) -> Reply:
|
||||
if "streamGenerateContent" in request.target:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue