-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grpc: Remove health check func dial option used for testing #7820
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7820 +/- ##
==========================================
- Coverage 82.00% 81.86% -0.15%
==========================================
Files 373 373
Lines 37735 37841 +106
==========================================
+ Hits 30945 30977 +32
- Misses 5512 5565 +53
- Partials 1278 1299 +21
|
clientconn.go
Outdated
@@ -1477,7 +1477,7 @@ func (ac *addrConn) startHealthCheck(ctx context.Context) { | |||
} | |||
// Start the health checking stream. | |||
go func() { | |||
err := ac.cc.dopts.healthCheckFunc(ctx, newStream, setConnectivityState, healthCheckConfig.ServiceName) | |||
err := internal.HealthCheckFunc(ctx, newStream, setConnectivityState, healthCheckConfig.ServiceName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this use the local variable healthCheckFunc
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, changed to use the local var.
This PR removes the private
withHealthCheckFunc
dialoption which is used only in the health check tests. The tests are able to replace theHealthCheckFunc
var defined in theinternal
package directly and restore it as part of the test cleanup.Background
While working on the health producer changes which are part of generic health checks, I needed to pass the dial option to the health producer while registering a health listener just to make the existing tests pass. The HealthCheckFunc would become a part of the producer's public API, even though it is required only for testing. I changed the tests to work without the dial option.
RELEASE NOTES: N/A