Adding the printing of error message when unexpected status returns.

pull/23216/head
Donna Dionne 5 years ago
parent 8bae46ba6c
commit 97904d77a4
  1. 52
      test/cpp/end2end/xds_end2end_test.cc

@ -4241,9 +4241,13 @@ TEST_P(BalancerUpdateTest, UpdateBalancersButKeepUsingOriginalBalancer) {
EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[1]->ads_service()->eds_response_state().error_message;
EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[2]->ads_service()->eds_response_state().error_message;
gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 1 ==========");
SetNextResolutionForLbChannel({balancers_[1]->port()});
gpr_log(GPR_INFO, "========= UPDATE 1 DONE ==========");
@ -4261,9 +4265,13 @@ TEST_P(BalancerUpdateTest, UpdateBalancersButKeepUsingOriginalBalancer) {
EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[1]->ads_service()->eds_response_state().error_message;
EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[2]->ads_service()->eds_response_state().error_message;
}
// Tests that the old LB call is still used after multiple balancer address
@ -4296,9 +4304,13 @@ TEST_P(BalancerUpdateTest, Repeated) {
EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[1]->ads_service()->eds_response_state().error_message;
EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[2]->ads_service()->eds_response_state().error_message;
std::vector<int> ports;
ports.emplace_back(balancers_[0]->port());
ports.emplace_back(balancers_[1]->port());
@ -4360,9 +4372,13 @@ TEST_P(BalancerUpdateTest, DeadUpdate) {
EXPECT_GT(balancers_[0]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[1]->ads_service()->eds_response_state().error_message;
EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[2]->ads_service()->eds_response_state().error_message;
// Kill balancer 0
gpr_log(GPR_INFO, "********** ABOUT TO KILL BALANCER 0 *************");
balancers_[0]->Shutdown();
@ -4376,11 +4392,17 @@ TEST_P(BalancerUpdateTest, DeadUpdate) {
EXPECT_EQ(0U, backends_[1]->backend_service()->request_count());
// The ADS service of no balancers sent anything
EXPECT_EQ(balancers_[0]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[0]->ads_service()->eds_response_state().error_message;
EXPECT_EQ(balancers_[1]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[1]->ads_service()->eds_response_state().error_message;
EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[2]->ads_service()->eds_response_state().error_message;
gpr_log(GPR_INFO, "========= ABOUT TO UPDATE 1 ==========");
SetNextResolutionForLbChannel({balancers_[1]->port()});
gpr_log(GPR_INFO, "========= UPDATE 1 DONE ==========");
@ -4398,11 +4420,15 @@ TEST_P(BalancerUpdateTest, DeadUpdate) {
EXPECT_EQ(10U, backends_[1]->backend_service()->request_count());
// The ADS service of balancer 1 sent at least 1 response.
EXPECT_EQ(balancers_[0]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[0]->ads_service()->eds_response_state().error_message;
EXPECT_GT(balancers_[1]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
EXPECT_EQ(balancers_[2]->ads_service()->eds_response_state().state,
AdsServiceImpl::ResponseState::NOT_SENT);
AdsServiceImpl::ResponseState::NOT_SENT)
<< "Error Message:"
<< balancers_[2]->ads_service()->eds_response_state().error_message;
}
// The re-resolution tests are deferred because they rely on the fallback mode,

Loading…
Cancel
Save