mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-14 15:05:48 +00:00
Fix/mcp health check cancelled error (#19851)
* Fix MCP health check CancelledError handling for parallel test execution Add asyncio.CancelledError handler in health_check_server() and missing @pytest.mark.asyncio decorator on test_mcp_server_manager_config_integration_with_database. In Python 3.8+, CancelledError inherits from BaseException, not Exception, so it bypassed the generic exception handler when pytest-xdist cancels running tasks after a failure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Regenerate poetry.lock to resolve merge conflict markers The lock file had unresolved conflict markers from a previous merge, causing poetry to fail with "Invalid statement (at line 8534, column 1)". Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2481,6 +2481,9 @@ class MCPServerManager:
|
||||
except asyncio.TimeoutError:
|
||||
health_check_error = "Health check timed out after 10 seconds"
|
||||
status = "unhealthy"
|
||||
except asyncio.CancelledError:
|
||||
health_check_error = "Health check was cancelled"
|
||||
status = "unknown"
|
||||
except Exception as e:
|
||||
health_check_error = str(e)
|
||||
status = "unhealthy"
|
||||
|
||||
@@ -1053,6 +1053,7 @@ async def test_mcp_server_manager_access_groups_from_config():
|
||||
mcp_server_manager_mod.global_mcp_server_manager = original_manager
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_mcp_server_manager_config_integration_with_database():
|
||||
"""
|
||||
Test that config-based servers properly integrate with database servers,
|
||||
|
||||
Reference in New Issue
Block a user