Fixing xds_end2end_test.cc: ClientLoadReporting Vanilla tests

1. sometimes the StreamLoadStats service (in a separate thread) is not
    ready when we check to see if it has received and responded to request;
    moving the check to a bit later after we know that it has processed a
    report.
    2. Drop test numbers can fall out of range by little bit: 366 > 360.6;
    increasing traffic to smooth the result (this fix has been effective for
    other similar flakes)
pull/22761/head
Donna Dionne 5 years ago
parent 6be8d5e76f
commit 0452c2a0cb
  1. 8
      test/cpp/end2end/xds_end2end_test.cc

@ -3826,9 +3826,6 @@ TEST_P(ClientLoadReportingTest, Vanilla) {
EXPECT_EQ(kNumRpcsPerAddress + kNumFailuresPerAddress, EXPECT_EQ(kNumRpcsPerAddress + kNumFailuresPerAddress,
backends_[i]->backend_service()->request_count()); backends_[i]->backend_service()->request_count());
} }
// The LRS service got a single request, and sent a single response.
EXPECT_EQ(1U, balancers_[0]->lrs_service()->request_count());
EXPECT_EQ(1U, balancers_[0]->lrs_service()->response_count());
// The load report received at the balancer should be correct. // The load report received at the balancer should be correct.
std::vector<ClientStats> load_report = std::vector<ClientStats> load_report =
balancers_[0]->lrs_service()->WaitForLoadReport(); balancers_[0]->lrs_service()->WaitForLoadReport();
@ -3843,6 +3840,9 @@ TEST_P(ClientLoadReportingTest, Vanilla) {
EXPECT_EQ(kNumFailuresPerAddress * num_backends_ + num_failure, EXPECT_EQ(kNumFailuresPerAddress * num_backends_ + num_failure,
client_stats.total_error_requests()); client_stats.total_error_requests());
EXPECT_EQ(0U, client_stats.total_dropped_requests()); EXPECT_EQ(0U, client_stats.total_dropped_requests());
// The LRS service got a single request, and sent a single response.
EXPECT_EQ(1U, balancers_[0]->lrs_service()->request_count());
EXPECT_EQ(1U, balancers_[0]->lrs_service()->response_count());
} }
// Tests that we don't include stats for clusters that are not requested // Tests that we don't include stats for clusters that are not requested
@ -3956,7 +3956,7 @@ class ClientLoadReportingWithDropTest : public XdsEnd2endTest {
TEST_P(ClientLoadReportingWithDropTest, Vanilla) { TEST_P(ClientLoadReportingWithDropTest, Vanilla) {
SetNextResolution({}); SetNextResolution({});
SetNextResolutionForLbChannelAllBalancers(); SetNextResolutionForLbChannelAllBalancers();
const size_t kNumRpcs = 3000; const size_t kNumRpcs = 5000;
const uint32_t kDropPerMillionForLb = 100000; const uint32_t kDropPerMillionForLb = 100000;
const uint32_t kDropPerMillionForThrottle = 200000; const uint32_t kDropPerMillionForThrottle = 200000;
const double kDropRateForLb = kDropPerMillionForLb / 1000000.0; const double kDropRateForLb = kDropPerMillionForLb / 1000000.0;

Loading…
Cancel
Save