Skip to content

interop testing: log the peer address in interop soak client#5419

Merged
easwars merged 2 commits into
grpc:masterfrom
apolcyn:log_peer
Jun 21, 2022
Merged

interop testing: log the peer address in interop soak client#5419
easwars merged 2 commits into
grpc:masterfrom
apolcyn:log_peer

Conversation

@apolcyn
Copy link
Copy Markdown
Contributor

@apolcyn apolcyn commented Jun 14, 2022

This helps debugging and makes it easy to set up tests that inspect the RPC distribution across different backends.

I've opened grpc/grpc#30012 to document this logging output across languages.

RELEASE NOTES: none

@apolcyn apolcyn marked this pull request as ready for review June 14, 2022 05:38
@zasweq zasweq self-assigned this Jun 14, 2022
Comment thread interop/test_utils.go Outdated
}

func doOneSoakIteration(ctx context.Context, tc testgrpc.TestServiceClient, resetChannel bool, serverAddr string, dopts []grpc.DialOption) (latency time.Duration, err error) {
func doOneSoakIteration(ctx context.Context, tc testgrpc.TestServiceClient, resetChannel bool, serverAddr string, dopts []grpc.DialOption) (latency time.Duration, peer peer.Peer, err error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I admit this is existing art, but naked returns are not ideal for anything other than really small functions.
See: go/go-style/decisions#named-result-parameters

Not asking you change that in this PR, but if we can avoid adding more named result parameters to this function, that would be nice.

One option is to pass call options to this function. So, something like this:

func doOneSoakIteration(ctx context.Context, tc testgrpc.TestServiceClient, resetChannel bool, serverAddr string, dopts []grpc.DialOption, copts []grpc.CallOption) (latency time.Duration, err error) {
  ...
  reply, err = client.UnaryCall(ctx, req, copts...)
  ...
}

And then, the caller can create the peer.Peer, pass it as a CallOption to this function, and inspect the former after the RPC. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea - done

@apolcyn apolcyn removed their assignment Jun 17, 2022
@easwars easwars added this to the 1.48 Release milestone Jun 17, 2022
@easwars easwars merged commit b288a24 into grpc:master Jun 21, 2022
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 19, 2022
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.

3 participants