Merge pull request #20432 from AspirinSJL/tune_xds

Tune xds test
pull/20495/head
Juanli Shen 5 years ago committed by GitHub
commit e130018bf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      test/cpp/end2end/xds_end2end_test.cc

@ -1571,7 +1571,7 @@ TEST_F(DropTest, DropPerTenThousand) {
TEST_F(DropTest, Update) { TEST_F(DropTest, Update) {
SetNextResolution({}, kDefaultServiceConfig_.c_str()); SetNextResolution({}, kDefaultServiceConfig_.c_str());
SetNextResolutionForLbChannelAllBalancers(); SetNextResolutionForLbChannelAllBalancers();
const size_t kNumRpcs = 5000; const size_t kNumRpcs = 1000;
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;
@ -1610,7 +1610,7 @@ TEST_F(DropTest, Update) {
gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH =========="); gpr_log(GPR_INFO, "========= DONE WITH FIRST BATCH ==========");
// The drop rate should be roughly equal to the expectation. // The drop rate should be roughly equal to the expectation.
double seen_drop_rate = static_cast<double>(num_drops) / kNumRpcs; double seen_drop_rate = static_cast<double>(num_drops) / kNumRpcs;
const double kErrorTolerance = 0.2; const double kErrorTolerance = 0.3;
EXPECT_THAT( EXPECT_THAT(
seen_drop_rate, seen_drop_rate,
::testing::AllOf(::testing::Ge(kDropRateForLb * (1 - kErrorTolerance)), ::testing::AllOf(::testing::Ge(kDropRateForLb * (1 - kErrorTolerance)),

Loading…
Cancel
Save