aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/end2end/round_robin_end2end_test.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-11-18 10:29:04 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-11-18 10:29:04 -0800
commitb28c7e8710638b362e5bfdd7dd81a45241c376e8 (patch)
treefb8bc4e3e6c705e63bc1a4f441f5c1a624f29558 /test/cpp/end2end/round_robin_end2end_test.cc
parentf2752ebb3b81cbad4e3b9ac0df5d7021c4659243 (diff)
parent91936b32f67c26f7189b7081bcb53e46ea8ba641 (diff)
Merge github.com:grpc/grpc into slice_with_exec_ctx
Diffstat (limited to 'test/cpp/end2end/round_robin_end2end_test.cc')
-rw-r--r--test/cpp/end2end/round_robin_end2end_test.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/cpp/end2end/round_robin_end2end_test.cc b/test/cpp/end2end/round_robin_end2end_test.cc
index 76211cbdd3..cc340b96b3 100644
--- a/test/cpp/end2end/round_robin_end2end_test.cc
+++ b/test/cpp/end2end/round_robin_end2end_test.cc
@@ -109,9 +109,9 @@ class RoundRobinEnd2endTest : public ::testing::Test {
uri << "127.0.0.1:" << servers_[i]->port_ << ",";
}
uri << "127.0.0.1:" << servers_[servers_.size() - 1]->port_;
- std::shared_ptr<Channel> channel =
+ channel_ =
CreateCustomChannel(uri.str(), InsecureChannelCredentials(), args);
- stub_ = grpc::testing::EchoTestService::NewStub(channel);
+ stub_ = grpc::testing::EchoTestService::NewStub(channel_);
}
void SendRpc(int num_rpcs) {
@@ -165,6 +165,7 @@ class RoundRobinEnd2endTest : public ::testing::Test {
const grpc::string server_host_;
CompletionQueue cli_cq_;
+ std::shared_ptr<Channel> channel_;
std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_;
std::vector<std::unique_ptr<ServerData>> servers_;
};
@@ -186,6 +187,8 @@ TEST_F(RoundRobinEnd2endTest, PickFirst) {
}
}
EXPECT_TRUE(found);
+ // Check LB policy name for the channel.
+ EXPECT_EQ("pick_first", channel_->GetLoadBalancingPolicyName());
}
TEST_F(RoundRobinEnd2endTest, RoundRobin) {
@@ -198,6 +201,8 @@ TEST_F(RoundRobinEnd2endTest, RoundRobin) {
for (size_t i = 0; i < servers_.size(); ++i) {
EXPECT_EQ(1, servers_[i]->service_.request_count());
}
+ // Check LB policy name for the channel.
+ EXPECT_EQ("round_robin", channel_->GetLoadBalancingPolicyName());
}
} // namespace