Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Commit

Permalink
Fix flaky test ObsoleteFiles
Browse files Browse the repository at this point in the history
Summary: The test `ObsoleteFiles` failed occasionally on slow device. This problem appears on Travis CI several times. The reason is that we did not wait until compaction jobs are finished in the test, while in slower device the background jobs take longer time to finish.

Test Plan: Pass existing tests.

Reviewers: yiwu, sdong

Reviewed By: sdong

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D61479
  • Loading branch information
omegaga committed Aug 3, 2016
1 parent 8234faa commit c3a4bea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/compact_files_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <thread>
#include <vector>

#include "db/db_impl.h"
#include "rocksdb/db.h"
#include "rocksdb/env.h"
#include "util/string_util.h"
Expand Down Expand Up @@ -144,6 +145,7 @@ TEST_F(CompactFilesTest, ObsoleteFiles) {

auto l0_files = collector->GetFlushedFiles();
ASSERT_OK(db->CompactFiles(CompactionOptions(), l0_files, 1));
reinterpret_cast<DBImpl*>(db)->TEST_WaitForCompact();

// verify all compaction input files are deleted
for (auto fname : l0_files) {
Expand Down

0 comments on commit c3a4bea

Please sign in to comment.