Fix flakiness in grpclb_end2end_test ReresolveDeadBalancer test case.

pull/22535/head
Mark D. Roth 5 years ago
parent aaea104312
commit dcdd04fcaa
  1. 14
      test/cpp/end2end/grpclb_end2end_test.cc

@ -1717,6 +1717,13 @@ class UpdatesWithClientLoadReportingTest : public GrpclbEnd2endTest {
};
TEST_F(UpdatesWithClientLoadReportingTest, ReresolveDeadBalancer) {
const std::vector<int> first_backend{GetBackendPorts()[0]};
const std::vector<int> second_backend{GetBackendPorts()[1]};
ScheduleResponseForBalancer(
0, BalancerServiceImpl::BuildResponseForBackends(first_backend, {}), 0);
ScheduleResponseForBalancer(
1, BalancerServiceImpl::BuildResponseForBackends(second_backend, {}), 0);
// Ask channel to connect to trigger resolver creation.
channel_->GetState(true);
std::vector<AddressData> addresses;
@ -1725,13 +1732,6 @@ TEST_F(UpdatesWithClientLoadReportingTest, ReresolveDeadBalancer) {
addresses.clear();
addresses.emplace_back(AddressData{balancers_[1]->port_, true, ""});
SetNextReresolutionResponse(addresses);
const std::vector<int> first_backend{GetBackendPorts()[0]};
const std::vector<int> second_backend{GetBackendPorts()[1]};
ScheduleResponseForBalancer(
0, BalancerServiceImpl::BuildResponseForBackends(first_backend, {}), 0);
ScheduleResponseForBalancer(
1, BalancerServiceImpl::BuildResponseForBackends(second_backend, {}), 0);
// Start servers and send 10 RPCs per server.
gpr_log(GPR_INFO, "========= BEFORE FIRST BATCH ==========");

Loading…
Cancel
Save