Merge pull request #21882 from donnadionne/fake_impl4

Converting AdsServiceImpl to a fake
pull/22228/head
donnadionne 5 years ago committed by GitHub
commit 49d211ac33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/core/ext/filters/client_channel/xds/xds_client.cc
  2. 9
      src/core/lib/gprpp/sync.h
  3. 1139
      test/cpp/end2end/xds_end2end_test.cc

@ -1524,8 +1524,11 @@ void XdsClient::ChannelState::LrsCallState::MaybeStartReportingLocked() {
// Don't start if the ADS call hasn't received any valid response. Note that
// this must be the first channel because it is the current channel but its
// ADS call hasn't seen any response.
AdsCallState* ads_calld = chand()->ads_calld_->calld();
if (ads_calld == nullptr || !ads_calld->seen_response()) return;
if (chand()->ads_calld_ == nullptr ||
chand()->ads_calld_->calld() == nullptr ||
!chand()->ads_calld_->calld()->seen_response()) {
return;
}
// Start reporting.
reporter_ = MakeOrphanable<Reporter>(
Ref(DEBUG_LOCATION, "LRS+load_report+start"), load_reporting_interval_);

@ -117,6 +117,15 @@ class CondVar {
}
}
// Returns true iff we timed-out
template <typename Predicate>
bool WaitUntil(Mutex* mu, Predicate pred, const gpr_timespec& deadline) {
while (!pred()) {
if (Wait(mu, deadline)) return true;
}
return false;
}
private:
gpr_cv cv_;
};

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save