Skip to content

Commit d63ae5c

Browse files
committed
Adjust memtable sizes in unit test
1 parent 64904b3 commit d63ae5c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

db/column_family_test.cc

+7-5
Original file line numberDiff line numberDiff line change
@@ -731,10 +731,12 @@ TEST(ColumnFamilyTest, DifferentCompactionStyles) {
731731
dbfull()->TEST_CompactRange(1, nullptr, nullptr, handles_[0]);
732732
ASSERT_EQ(NumTableFilesAtLevel(0, 0), 0);
733733
ASSERT_EQ(NumTableFilesAtLevel(1, 0), 0);
734-
// write some new keys into level 0
735-
PutRandomData(0, 120, 4096);
734+
// write some new keys into level 0 and 1
735+
PutRandomData(0, 1024, 512);
736736
ASSERT_OK(Flush(0));
737737
WaitForCompaction();
738+
PutRandomData(0, 10, 512);
739+
ASSERT_OK(Flush(0));
738740
// remember number of files in each level
739741
int l1 = NumTableFilesAtLevel(0, 0);
740742
int l2 = NumTableFilesAtLevel(1, 0);
@@ -745,14 +747,14 @@ TEST(ColumnFamilyTest, DifferentCompactionStyles) {
745747

746748
// SETUP column family "one" -- universal style
747749
for (int i = 0; i < one.level0_file_num_compaction_trigger - 1; ++i) {
748-
PutRandomData(1, 20, 10000);
750+
PutRandomData(1, 11, 10000);
749751
WaitForFlush(1);
750752
ASSERT_EQ(std::to_string(i + 1), FilesPerLevel(1));
751753
}
752754

753755
// SETUP column family "two" -- level style with 4 levels
754756
for (int i = 0; i < two.level0_file_num_compaction_trigger - 1; ++i) {
755-
PutRandomData(2, 20, 10000);
757+
PutRandomData(2, 15, 10000);
756758
WaitForFlush(2);
757759
ASSERT_EQ(std::to_string(i + 1), FilesPerLevel(2));
758760
}
@@ -767,7 +769,7 @@ TEST(ColumnFamilyTest, DifferentCompactionStyles) {
767769
PutRandomData(1, 12, 10000);
768770

769771
// TRIGGER compaction "two"
770-
PutRandomData(2, 12, 10000);
772+
PutRandomData(2, 10, 10000);
771773

772774
// WAIT for compactions
773775
WaitForCompaction();

0 commit comments

Comments
 (0)