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

Loading…
Cancel
Save