From 53a0ab2beac75b88ade9ed6523425fc9e54518da Mon Sep 17 00:00:00 2001 From: Jay Zhuang Date: Mon, 18 Oct 2021 15:14:01 -0700 Subject: [PATCH] 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. https://github.com/facebook/rocksdb/blob/fcaa7ff6381fe6052b37a1d013b14960ea23ac17/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 --- db/obsolete_files_test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/obsolete_files_test.cc b/db/obsolete_files_test.cc index d4348283cb..1595b7283d 100644 --- a/db/obsolete_files_test.cc +++ b/db/obsolete_files_test.cc @@ -54,7 +54,9 @@ class ObsoleteFilesTest : public DBTestBase { AddKeys(numKeysPerFile, startKey); startKey += numKeysPerFile; 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). } }