Merge pull request #24141 from donnadionne/flake

Fixing flake in DeadUpdate
pull/24149/head
donnadionne 4 years ago committed by GitHub
commit 153af916d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      test/cpp/end2end/xds_end2end_test.cc

@ -766,19 +766,22 @@ class AdsServiceImpl : public std::enable_shared_from_this<AdsServiceImpl> {
request.DebugString().c_str());
const std::string v3_resource_type =
TypeUrlToV3(request.type_url());
// Identify ACK and NACK by looking for version information and
// comparing it to nonce (this server ensures they are always set
// to the same in a response.)
if (!request.response_nonce().empty()) {
parent_->resource_type_response_state_[v3_resource_type].state =
(!request.version_info().empty() &&
request.version_info() == request.response_nonce())
? ResponseState::ACKED
: ResponseState::NACKED;
}
if (request.has_error_detail()) {
parent_->resource_type_response_state_[v3_resource_type]
.error_message = request.error_detail().message();
// As long as we are not in shutdown, identify ACK and NACK by
// looking for version information and comparing it to nonce (this
// server ensures they are always set to the same in a response.)
auto it =
parent_->resource_type_response_state_.find(v3_resource_type);
if (it != parent_->resource_type_response_state_.end()) {
if (!request.response_nonce().empty()) {
it->second.state =
(!request.version_info().empty() &&
request.version_info() == request.response_nonce())
? ResponseState::ACKED
: ResponseState::NACKED;
}
if (request.has_error_detail()) {
it->second.error_message = request.error_detail().message();
}
}
// As long as the test did not tell us to ignore this type of
// request, we will loop through all resources to:

Loading…
Cancel
Save