From 8cbe3e10cab26a242286c90d8f9e6eda9b98114c Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Thu, 13 Oct 2016 14:26:12 -0700 Subject: [PATCH] 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 --- util/rate_limiter_test.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/rate_limiter_test.cc b/util/rate_limiter_test.cc index 0104be3e5..0829f67e2 100644 --- a/util/rate_limiter_test.cc +++ b/util/rate_limiter_test.cc @@ -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); } } }