Add comprehensive test coverage for remote MCP server health check failures#3084
Merged
Add comprehensive test coverage for remote MCP server health check failures#3084
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3084 +/- ##
==========================================
+ Coverage 63.66% 63.78% +0.11%
==========================================
Files 362 362
Lines 35521 35263 -258
==========================================
- Hits 22613 22491 -122
+ Misses 11089 10954 -135
+ Partials 1819 1818 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jhrozek
reviewed
Dec 17, 2025
Contributor
jhrozek
left a comment
There was a problem hiding this comment.
Good test coverage for the health check failure scenarios!
eleftherias
previously approved these changes
Dec 22, 2025
…lth-check-failure
…lth-check-failure
dmjb
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive test coverage for remote MCP server health check failure scenarios, ensuring that the health check callback mechanism works correctly when remote servers become unavailable.
Changes
TestTransparentProxy_RemoteServerFailure_5xxStatus- Tests 5xx status codes trigger callbackTestTransparentProxy_RemoteServerFailure_ConnectionRefused- Tests connection failuresTestTransparentProxy_RemoteServerFailure_Timeout- Tests timeout scenariosTestTransparentProxy_RemoteServerFailure_BecomesUnavailable- Tests server becoming unavailable after being healthyTestTransparentProxy_RemoteServerFailure_Different5xxCodes- Table-driven test for various 5xx codes (500, 502, 503, 504)TestTransparentProxy_RemoteServerHealthy_4xxCodes- Verifies 4xx codes are considered healthyTestTransparentProxy_HealthCheckNotRunBeforeInitialization- Ensures health checks skip until initializationTestTransparentProxy_HealthCheckFailureWithNilCallback- Tests graceful handling with nil callbackTechnical Improvements
IsServerInitializedfromint32toatomic.Boolfor thread-safe accessserverInitialized()getter method for better encapsulationTesting
-raceflag enabledhttptest.NewServerto simulate different failure scenariossync.Mutexfor callback trackingRelated
Addresses test coverage gap identified in PR #3077 for remote MCP server health check failure handling.