Improve the robustness of ThreadStatusSingleCompaction

Summary:
Improve the robustness of ThreadStatusSingleCompaction
by ensuring the number of files flushed in the test.

Test Plan:
export ROCKSDB_TESTS=ThreadStatus
./db_test

Reviewers: sdong, igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D35019
main
Yueh-Hsuan Chiang 10 years ago
parent 8c12426c93
commit c1b3cde18a
  1. 9
      db/db_test.cc

@ -10176,10 +10176,13 @@ TEST(DBTest, ThreadStatusSingleCompaction) {
DestroyAndReopen(options);
Random rnd(301);
for (int key = kEntriesPerBuffer * kNumL0Files; key >= 0; --key) {
ASSERT_OK(Put(ToString(key), RandomString(&rnd, kTestValueSize)));
for (int file = 0; file < kNumL0Files; ++file) {
for (int key = 0; key < kEntriesPerBuffer; ++key) {
ASSERT_OK(Put(ToString(key + file * kEntriesPerBuffer),
RandomString(&rnd, kTestValueSize)));
}
Flush();
}
Flush();
ASSERT_GE(NumTableFilesAtLevel(0),
options.level0_file_num_compaction_trigger);

Loading…
Cancel
Save