| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…modelcontextprotocol#1777) The flaky SSE tests (test_sse_client_basic_connection_mounted_app, test_request_context_isolation) fail intermittently because wait_for_server() only checks TCP port connectivity. On slow CI machines, the port may accept connections before the ASGI app is fully initialized, causing SSE requests to fail. - Add a two-stage readiness check to wait_for_server(): first TCP connect, then an actual HTTP request to verify the app is handling requests (any HTTP response, even 404, confirms readiness) - Remove unreachable dead code after blocking server.run() calls in run_server() and run_mounted_server() - Remove unused `time` import from test_sse.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The HTTP health check in wait_for_server() caused false-positive readiness signals for mounted Starlette apps (404 from root vs 404 from uninitialized routes are indistinguishable). Revert to TCP-only polling which matches the original behavior. Also remove the same dead-code pattern from test_ws.py (unreachable loop after blocking server.run()). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks! |
Sorry, something went wrong.
|
Thanks for the quick review, @Kludex! Happy to contribute 🙌 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #1777 — removes dead code that could never execute in the SSE and WebSocket test server setup functions.
Root cause
In run_server(), run_mounted_server() (test_sse.py) and run_server() (test_ws.py), there is a while not server.started polling loop placed after uvicorn.Server.run(). Since run() blocks until the server shuts down, the polling loop is unreachable dead code. Server readiness is already handled by the wait_for_server() helper in the test fixtures.
Changes
Test plan
🤖 Generated with Claude Code