Fix flakiness in xds_cluster_end2end_test: XdsTest/CdsTest.CircuitBreaking/V3 (#32027)

* Fix flakiness in xds_cluster_end2end_test: XdsTest/CdsTest.CircuitBreaking/V3

* update comment and add sleep in one more instance
pull/32037/head
Vignesh Babu 2 years ago committed by GitHub
parent 2904ee8fd3
commit 4806da6041
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      test/cpp/end2end/xds/xds_cluster_end2end_test.cc

@ -218,6 +218,12 @@ TEST_P(CdsTest, CircuitBreaking) {
"circuit breaker drop");
// Cancel one RPC to allow another one through.
rpcs[0].CancelRpc();
// Add a sleep here to ensure the RPC cancellation has completed correctly
// before trying the next RPC. There maybe a slight delay between return of
// CANCELLED RPC status and update of internal state tracking the number of
// concurrent active requests.
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_millis(1000, GPR_TIMESPAN)));
CheckRpcSendOk(DEBUG_LOCATION);
// Clean up.
for (size_t i = 1; i < kMaxConcurrentRequests; ++i) {
@ -258,6 +264,12 @@ TEST_P(CdsTest, CircuitBreakingMultipleChannelsShareCallCounter) {
"circuit breaker drop");
// Cancel one RPC to allow another one through
rpcs[0].CancelRpc();
// Add a sleep here to ensure the RPC cancellation has completed correctly
// before trying the next RPC. There maybe a slight delay between return of
// CANCELLED RPC status and update of internal state tracking the number of
// concurrent active requests.
gpr_sleep_until(gpr_time_add(gpr_now(GPR_CLOCK_REALTIME),
gpr_time_from_millis(1000, GPR_TIMESPAN)));
CheckRpcSendOk(DEBUG_LOCATION);
// Clean up.
for (size_t i = 1; i < kMaxConcurrentRequests; ++i) {

Loading…
Cancel
Save