mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
* test(integration): wait for customer spend rows and use owned OpenRouter cost * ci: isolate integration workers and clean up resources after crashes * docs: describe isolated extensions workers and shard census * fix(ci): restore integration service and fixture guarantees * fix(integration): preserve replay IDs and native route fixtures * fix(tests): scope integration harness imports to each unit case * fix(ci): preserve fixtures and wait for owned workers * fix(ci): isolate nested runs and telemetry cases * fix(ci): make worker readiness and fault tests deterministic * chore(ci): drop MCP fixture repair already covered by main * chore(ci): keep the local catalog fix from main --------- Co-authored-by: yuneng <yuneng@berri.ai>
32 lines
1,015 B
Python
32 lines
1,015 B
Python
import asyncio
|
|
import os
|
|
from concurrent.futures import ThreadPoolExecutor
|
|
from typing import Final
|
|
|
|
from fastapi import Response
|
|
from fastapi.responses import JSONResponse
|
|
from pydantic import TypeAdapter
|
|
|
|
READINESS_BODY: Final = TypeAdapter(dict[str, object])
|
|
|
|
|
|
def configure_executor() -> None:
|
|
asyncio.get_running_loop().set_default_executor(
|
|
ThreadPoolExecutor(max_workers=32, thread_name_prefix="integration-provider")
|
|
)
|
|
|
|
|
|
async def worker_readiness() -> JSONResponse:
|
|
from litellm.proxy.health_endpoints._health_endpoints import health_readiness
|
|
|
|
response: Final = Response()
|
|
body: Final = READINESS_BODY.validate_python(await health_readiness(response))
|
|
return JSONResponse(
|
|
content=body, status_code=response.status_code, headers={"x-integration-worker-pid": str(os.getpid())}
|
|
)
|
|
|
|
|
|
def configure_readiness() -> None:
|
|
from litellm.proxy.proxy_server import app
|
|
|
|
app.add_api_route("/health/integration-readiness", worker_readiness, include_in_schema=False)
|