Skip to content

Conversation

@easwars
Copy link
Contributor

@easwars easwars commented Sep 10, 2024

Addresses #7291

RELEASE NOTES: none

@easwars easwars requested a review from dfawley September 10, 2024 21:19
@easwars easwars added this to the 1.68 Release milestone Sep 10, 2024
@codecov
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.84%. Comparing base (8f920c6) to head (30fdff2).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
internal/stubserver/stubserver.go 71.42% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7613      +/-   ##
==========================================
- Coverage   82.01%   81.84%   -0.18%     
==========================================
  Files         361      361              
  Lines       27813    27817       +4     
==========================================
- Hits        22812    22767      -45     
- Misses       3822     3853      +31     
- Partials     1179     1197      +18     
Files with missing lines Coverage Δ
orca/service.go 77.50% <100.00%> (+5.00%) ⬆️
internal/stubserver/stubserver.go 83.48% <71.42%> (-1.28%) ⬇️

... and 20 files with indirect coverage changes


// StoppableServiceRegistrar is an interface that extends the grpc.ServiceRegistrar
// interface with additional methods to stop and gracefully stop the server.
type StoppableServiceRegistrar interface {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you feel about calling this GRPCServer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


handler, ok := ss.S.(interface{ http.Handler })
if !ok {
return fmt.Errorf("server of type %T does not implement http.Handler", ss.S)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

panic instead? This is a programming error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to panic. The ServeHTTP method is only supported by the grpc.Server and not by the xds.GRPCServer, but I think it's fine to panic here since tests shouldn't be trying to server HTTP using an xds-enabled grpc server.

@dfawley dfawley assigned easwars and unassigned dfawley Sep 12, 2024
@easwars easwars assigned dfawley and unassigned easwars Sep 12, 2024
@dfawley dfawley assigned easwars and unassigned dfawley Sep 12, 2024
@easwars easwars merged commit cf5d541 into grpc:master Sep 12, 2024
13 checks passed
@easwars easwars deleted the stubserver_enhancement branch September 12, 2024 22:00
arjan-bal added a commit to arjan-bal/grpc-go that referenced this pull request Sep 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants