Skip to content
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

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

arjan-bal
Copy link
Contributor

@arjan-bal arjan-bal commented Nov 7, 2024

This PR removes the private withHealthCheckFunc dialoption which is used only in the health check tests. The tests are able to replace the HealthCheckFunc var defined in the internal 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

@arjan-bal arjan-bal added Type: Internal Cleanup Refactors, etc Area: Client Includes Channel/Subchannel/Streams, Connectivity States, RPC Retries, Dial/Call Options and more. labels Nov 7, 2024
@arjan-bal arjan-bal added this to the 1.69 Release milestone Nov 7, 2024
@arjan-bal arjan-bal requested review from easwars and dfawley November 7, 2024 10:01
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.86%. Comparing base (18d218d) to head (7e02615).
Report is 3 commits behind head on master.

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     
Files with missing lines Coverage Δ
clientconn.go 92.14% <100.00%> (-0.28%) ⬇️
dialoptions.go 88.97% <ø> (-0.31%) ⬇️

... and 24 files with indirect coverage changes

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@easwars easwars assigned arjan-bal and unassigned easwars Nov 7, 2024
@arjan-bal arjan-bal merged commit 74738cf into grpc:master Nov 8, 2024
15 checks passed
@arjan-bal arjan-bal deleted the remove-health-check-dial-opt branch November 8, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Client Includes Channel/Subchannel/Streams, Connectivity States, RPC Retries, Dial/Call Options and more. Type: Internal Cleanup Refactors, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants