diff --git a/db/db_wal_test.cc b/db/db_wal_test.cc index a96204937..554a184f8 100644 --- a/db/db_wal_test.cc +++ b/db/db_wal_test.cc @@ -146,6 +146,11 @@ TEST_F(DBWALTestWithEnrichedEnv, SkipDeletedWALs) { options.write_buffer_size = 128; Reopen(options); + SyncPoint::GetInstance()->LoadDependency( + {{"DBImpl::PurgeObsoleteFiles:End", + "DBWALTestWithEnrichedEnv.SkipDeletedWALs:AfterFlush"}}); + SyncPoint::GetInstance()->EnableProcessing(); + WriteOptions writeOpt = WriteOptions(); for (int i = 0; i < 128 * 5; i++) { ASSERT_OK(dbfull()->Put(writeOpt, "foo", "v1")); @@ -154,6 +159,8 @@ TEST_F(DBWALTestWithEnrichedEnv, SkipDeletedWALs) { fo.wait = true; ASSERT_OK(db_->Flush(fo)); + TEST_SYNC_POINT("DBWALTestWithEnrichedEnv.SkipDeletedWALs:AfterFlush"); + // some wals are deleted ASSERT_NE(0, enriched_env_->deleted_wal_cnt); // but not the first one @@ -164,6 +171,8 @@ TEST_F(DBWALTestWithEnrichedEnv, SkipDeletedWALs) { Reopen(options); ASSERT_FALSE(enriched_env_->deleted_wal_reopened); ASSERT_FALSE(enriched_env_->gap_in_wals); + + SyncPoint::GetInstance()->DisableProcessing(); } TEST_F(DBWALTest, WAL) {