fix minor nits

pull/19482/head
Qixuan Li 6 years ago
parent 0e85762b67
commit 913acf456b
  1. 2
      test/cpp/interop/client_helper.cc
  2. 11
      test/cpp/interop/interop_client.cc

@ -107,7 +107,7 @@ std::shared_ptr<Channel> CreateChannelForTestCase(
: AccessTokenCredentials(GetOauth2AccessToken());
} else if (test_case == "pick_first_unary") {
ChannelArguments channel_args;
// force using pick first policy
// allow the LB policy to be configured with service config
channel_args.SetInt(GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION, 0);
return CreateTestChannel(host_port, FLAGS_custom_credentials_type,
FLAGS_server_host_override, !FLAGS_use_test_ca,

@ -952,7 +952,7 @@ bool InteropClient::DoPickFirstUnary() {
const int rpcCount = 100;
SimpleRequest request;
SimpleResponse response;
std::string first_server_id;
std::string server_id;
request.set_fill_server_id(true);
for (int i = 0; i < rpcCount; i++) {
ClientContext context;
@ -961,11 +961,14 @@ bool InteropClient::DoPickFirstUnary() {
return false;
}
if (i == 0) {
first_server_id = response.server_id();
gpr_log(GPR_DEBUG, "first_user_id is %s", first_server_id.c_str());
server_id = response.server_id();
continue;
}
GPR_ASSERT(response.server_id() == first_server_id);
if (response.server_id() != server_id) {
gpr_log(GPR_ERROR, "#%d rpc hits server_id %s, expect server_id %s", i,
response.server_id().c_str(), server_id.c_str());
return false;
}
}
gpr_log(GPR_DEBUG, "pick first unary successfully finished");
return true;

Loading…
Cancel
Save