Relax the acceptable bias RateLimiterTest::Rate test be 25%

Summary:
In the current implementation of RateLimiter, the difference
between the configured rate and the actual rate might be more
than 20%, while our test only allows 15% difference.  This diff
relaxes the acceptable bias RateLimiterTest::Rate test be 25%
to make the test less flaky.

Test Plan: rate_limiter_test

Reviewers: IslamAbdelRahman, andrewkr, yiwu, lightmark, sdong

Reviewed By: sdong

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D64941
This commit is contained in:
Yueh-Hsuan Chiang 2016-10-13 14:26:12 -07:00
parent f26a139d89
commit 8cbe3e10ca

View File

@ -21,6 +21,7 @@
namespace rocksdb {
// TODO(yhchiang): the rate will not be accurate when we run test in parallel.
class RateLimiterTest : public testing::Test {};
TEST_F(RateLimiterTest, OverflowRate) {
@ -87,8 +88,8 @@ TEST_F(RateLimiterTest, Rate) {
arg.request_size - 1, target / 1024, rate / 1024,
elapsed / 1000000.0);
ASSERT_GE(rate / target, 0.85);
ASSERT_LE(rate / target, 1.15);
ASSERT_GE(rate / target, 0.80);
ASSERT_LE(rate / target, 1.25);
}
}
}