DBTest.MergeTestTime: relax counter upper bound verification

Summary: Timing counters' upper bounds depend on platform. It frequently fails in valgrind runs. Relax the upper bound.

Test Plan: Run the same valgrind test and make sure it passes.

Reviewers: rven, anthony, kradhakrishnan, IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D50829
main
sdong 9 years ago
parent 52e04b3d02
commit 5cbb7e43e0
  1. 10
      db/db_test.cc

@ -8282,8 +8282,11 @@ TEST_F(DBTest, MergeTestTime) {
std::string result;
db_->Get(opt, "foo", &result);
ASSERT_LT(TestGetTickerCount(options, MERGE_OPERATION_TOTAL_TIME), 2800000);
ASSERT_GT(TestGetTickerCount(options, MERGE_OPERATION_TOTAL_TIME), 1200000);
// Counter upper bound depends on platform. Just check a conservative
// large value.
ASSERT_LT(TestGetTickerCount(options, MERGE_OPERATION_TOTAL_TIME),
1000000000);
ReadOptions read_options;
std::unique_ptr<Iterator> iter(db_->NewIterator(read_options));
@ -8295,8 +8298,11 @@ TEST_F(DBTest, MergeTestTime) {
ASSERT_EQ(1, count);
ASSERT_LT(TestGetTickerCount(options, MERGE_OPERATION_TOTAL_TIME), 6000000);
ASSERT_GT(TestGetTickerCount(options, MERGE_OPERATION_TOTAL_TIME), 3200000);
// Counter upper bound depends on platform. Just check a conservative
// large value.
ASSERT_LT(TestGetTickerCount(options, MERGE_OPERATION_TOTAL_TIME),
1000000000);
#if ROCKSDB_USING_THREAD_STATUS
ASSERT_GT(TestGetTickerCount(options, FLUSH_WRITE_BYTES), 0);
#endif // ROCKSDB_USING_THREAD_STATUS

Loading…
Cancel
Save