Re-enable param tests for backup engine (#7260)
Summary: The param tests did not take any effect previously. This PR re-enables it. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7260 Test Plan: Some manual tests and `./backupable_db_test`. Reviewed By: siying Differential Revision: D23140902 Pulled By: pdillinger fbshipit-source-id: cd62b11b926affed25127d9074fa97a1c7f748c4
This commit is contained in:
parent
2ad88ceae9
commit
500eeb6fd3
@ -746,10 +746,8 @@ class BackupableDBTest : public testing::Test {
|
||||
db_.reset(db);
|
||||
}
|
||||
|
||||
void OpenDBAndBackupEngine(bool destroy_old_data = false, bool dummy = false,
|
||||
ShareOption shared_option = kShareNoChecksum) {
|
||||
// reset all the defaults
|
||||
test_backup_env_->SetLimitWrittenFiles(1000000);
|
||||
void InitializeDBAndBackupEngine(bool dummy = false) {
|
||||
// reset all the db env defaults
|
||||
test_db_env_->SetLimitWrittenFiles(1000000);
|
||||
test_db_env_->SetDummySequentialFile(dummy);
|
||||
|
||||
@ -761,14 +759,19 @@ class BackupableDBTest : public testing::Test {
|
||||
ASSERT_OK(DB::Open(options_, dbname_, &db));
|
||||
}
|
||||
db_.reset(db);
|
||||
}
|
||||
|
||||
virtual void OpenDBAndBackupEngine(
|
||||
bool destroy_old_data = false, bool dummy = false,
|
||||
ShareOption shared_option = kShareNoChecksum) {
|
||||
InitializeDBAndBackupEngine(dummy);
|
||||
// reset backup env defaults
|
||||
test_backup_env_->SetLimitWrittenFiles(1000000);
|
||||
backupable_options_->destroy_old_data = destroy_old_data;
|
||||
backupable_options_->share_table_files = shared_option != kNoShare;
|
||||
backupable_options_->share_files_with_checksum =
|
||||
shared_option == kShareWithChecksum;
|
||||
BackupEngine* backup_engine;
|
||||
ASSERT_OK(BackupEngine::Open(test_db_env_.get(), *backupable_options_,
|
||||
&backup_engine));
|
||||
backup_engine_.reset(backup_engine);
|
||||
OpenBackupEngine(destroy_old_data);
|
||||
}
|
||||
|
||||
void CloseDBAndBackupEngine() {
|
||||
@ -906,6 +909,17 @@ class BackupableDBTestWithParam : public BackupableDBTest,
|
||||
BackupableDBTestWithParam() {
|
||||
backupable_options_->share_files_with_checksum = GetParam();
|
||||
}
|
||||
void OpenDBAndBackupEngine(
|
||||
bool destroy_old_data = false, bool dummy = false,
|
||||
ShareOption shared_option = kShareNoChecksum) override {
|
||||
BackupableDBTest::InitializeDBAndBackupEngine(dummy);
|
||||
// reset backup env defaults
|
||||
test_backup_env_->SetLimitWrittenFiles(1000000);
|
||||
backupable_options_->destroy_old_data = destroy_old_data;
|
||||
backupable_options_->share_table_files = shared_option != kNoShare;
|
||||
// NOTE: keep share_files_with_checksum setting from constructor
|
||||
OpenBackupEngine(destroy_old_data);
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(BackupableDBTest, DbAndBackupSameCustomChecksum) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user