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

interop: add test case for "pick_first" #2762

Merged
merged 4 commits into from
Apr 11, 2019

Conversation

menghanl
Copy link
Contributor

Verify that all requests are sent to the same server.

Copy link
Contributor

@apolcyn apolcyn left a comment

Choose a reason for hiding this comment

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

LGTM with some nits. Thanks for doing this

@@ -270,6 +271,9 @@ func main() {
case "unimplemented_service":
interop.DoUnimplementedService(testpb.NewUnimplementedServiceClient(conn))
grpclog.Infoln("UnimplementedService done")
case "pick_first_unary":
interop.DoPickFirstUnary(tc, 100)
Copy link
Contributor

Choose a reason for hiding this comment

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

small nit: might be better to unparameterize rpcCount and hardcode 100 directly into the body of DoPickFirstUnary - that, or make have it fully configurable via command arg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will go with hardcode now. Adding a flag only for one test case also seems bad...

}

// NewTestServer creates a test server for test service.
func NewTestServer() testpb.TestServiceServer {
return &testServer{}
return &testServer{
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not strictly necessary that the Go server implement this test case just yet, since there is a special interop server that's configured with the TXT record etc. which the client will run against. But no problem having it - up to you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will revert it for now. It adds a uuid dependency to gRPC.

continue
}
if serverID != id {
grpclog.Fatalf("got different server ids: %q vs %q", serverID, id)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: also log the iteration that it failed on?

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

@menghanl menghanl merged commit ee9f7f0 into grpc:master Apr 11, 2019
@menghanl menghanl deleted the interop_serverid branch April 11, 2019 21:23
@lock lock bot locked as resolved and limited conversation to collaborators Oct 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants