Skip to content

Commit

Permalink
Fix flakiness in FIFOCompaction test (github issue #573)
Browse files Browse the repository at this point in the history
Summary:
The problem is that sometimes two memtables will be compacted together into a single file. In that case, our assertion

        ASSERT_EQ(NumTableFilesAtLevel(0), 5);

fails because same amount of data is in 4 files instead of 5. We should wait for flush so that we prevent two memtables merging into a single file.

Test Plan: `for i in `seq 20`; do mrtest FIFOCompactionTest; done` -- fails at least once before. fails zero times after.

Reviewers: rven

Reviewed By: rven

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D36939
  • Loading branch information
igorcanadi committed Apr 13, 2015
1 parent abb4052 commit e7ad149
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9613,6 +9613,7 @@ TEST_F(DBTest, FIFOCompactionTest) {
ASSERT_OK(Put(ToString(i * 100 + j), RandomString(&rnd, 1024)));
}
// flush should happen here
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable());
}
if (iter == 0) {
ASSERT_OK(dbfull()->TEST_WaitForCompact());
Expand Down

0 comments on commit e7ad149

Please sign in to comment.