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:
jquinter
2026-02-06 13:02:30 -03:00
committed by Sameer Kankute
parent 2875fe8e49
commit e78d17cd0a
2 changed files with 4 additions and 0 deletions
@@ -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"
+1
View File
@@ -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,