Files
AutoGPT/autogpt_platform/backend
Zamil Majdy 23f092d65c fix(backend/mcp): Use httpx.AsyncClient in test_routes to prevent event loop corruption
Replace fastapi.testclient.TestClient with httpx.AsyncClient + ASGITransport.

TestClient creates a new anyio blocking portal per request. When 11+ portals
are created and destroyed in a session that also has pytest-asyncio session-scoped
async fixtures, the session event loop gets corrupted, causing
"RuntimeError: Event loop is closed" in subsequent async tests.

AsyncClient with ASGITransport runs the ASGI app directly in the current
event loop without creating blocking portals.
2026-02-11 06:39:14 +04:00
..