Deflaky ObsoleteFilesTest (#9049)

Summary:
WaitForFlushMemTable() may only wait for mem flush but not background flush
finishing. The the obsoleted file may not be purged yet.
fcaa7ff638/db/db_impl/db_impl_compaction_flush.cc (L2200-L2203)

Use WaitForCompact() instead to wait for background flush job.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9049

Test Plan: `gtest-parallel ./obsolete_files_test --gtest_filter=ObsoleteFilesTest.DeleteObsoleteOptionsFile -r 1000`

Reviewed By: zhichao-cao

Differential Revision: D31737343

Pulled By: jay-zhuang

fbshipit-source-id: 82276ebeae7c7c75a733d3e1fd1c130d45e4761f
This commit is contained in:
Jay Zhuang 2021-10-18 15:14:01 -07:00 committed by Facebook GitHub Bot
parent b4326b5273
commit 53a0ab2bea

View file

@ -54,7 +54,9 @@ class ObsoleteFilesTest : public DBTestBase {
AddKeys(numKeysPerFile, startKey); AddKeys(numKeysPerFile, startKey);
startKey += numKeysPerFile; startKey += numKeysPerFile;
ASSERT_OK(dbfull()->TEST_FlushMemTable()); ASSERT_OK(dbfull()->TEST_FlushMemTable());
ASSERT_OK(dbfull()->TEST_WaitForFlushMemTable()); ASSERT_OK(
dbfull()->TEST_WaitForCompact()); // wait for background flush (flush
// is also a kind of compaction).
} }
} }