From 43ec4e68ba609b246993f1d8dfb33f4657382ecf Mon Sep 17 00:00:00 2001 From: sdong Date: Fri, 23 Jan 2015 16:26:38 -0800 Subject: [PATCH] fault_injection_test: bring back 3 iteration runs Summary: 3 iterations were disabled by mistake by one recent commit, causing CLANG build error. Fix it Test Plan: USE_CLANG=1 make fault_injection_test and run the test Reviewers: igor Reviewed By: igor Subscribers: leveldb, dhruba Differential Revision: https://reviews.facebook.net/D32109 --- db/fault_injection_test.cc | 60 ++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/db/fault_injection_test.cc b/db/fault_injection_test.cc index 41664e728..a014726ab 100644 --- a/db/fault_injection_test.cc +++ b/db/fault_injection_test.cc @@ -620,39 +620,41 @@ TEST(FaultInjectionTest, FaultTest) { Random rnd(301); ASSERT_OK(SetUp()); - int num_pre_sync = rnd.Uniform(kMaxNumValues); - int num_post_sync = rnd.Uniform(kMaxNumValues); + for (size_t idx = 0; idx < kNumIterations; idx++) { + int num_pre_sync = rnd.Uniform(kMaxNumValues); + int num_post_sync = rnd.Uniform(kMaxNumValues); - PartialCompactTestPreFault(num_pre_sync, num_post_sync); - PartialCompactTestReopenWithFault(kResetDropUnsyncedData, num_pre_sync, - num_post_sync); - NoWriteTestPreFault(); - NoWriteTestReopenWithFault(kResetDropUnsyncedData); - - // TODO(t6070540) Need to sync WAL Dir and other DB paths too. - - // Setting a separate data path won't pass the test as we don't sync - // it after creating new files, - if (option_config_ != kDifferentDataDir) { PartialCompactTestPreFault(num_pre_sync, num_post_sync); - // Since we don't sync WAL Dir, this test dosn't pass. - if (option_config_ != kWalDirSyncWal) { - PartialCompactTestReopenWithFault(kResetDropAndDeleteUnsynced, - num_pre_sync, num_post_sync); - } + PartialCompactTestReopenWithFault(kResetDropUnsyncedData, num_pre_sync, + num_post_sync); NoWriteTestPreFault(); - NoWriteTestReopenWithFault(kResetDropAndDeleteUnsynced); - - PartialCompactTestPreFault(num_pre_sync, num_post_sync); - // No new files created so we expect all values since no files will be - // dropped. - // WAL Dir is not synced for now. - if (option_config_ != kWalDir && option_config_ != kWalDirSyncWal) { - PartialCompactTestReopenWithFault(kResetDeleteUnsyncedFiles, - num_pre_sync + num_post_sync, 0); + NoWriteTestReopenWithFault(kResetDropUnsyncedData); + + // TODO(t6070540) Need to sync WAL Dir and other DB paths too. + + // Setting a separate data path won't pass the test as we don't sync + // it after creating new files, + if (option_config_ != kDifferentDataDir) { + PartialCompactTestPreFault(num_pre_sync, num_post_sync); + // Since we don't sync WAL Dir, this test dosn't pass. + if (option_config_ != kWalDirSyncWal) { + PartialCompactTestReopenWithFault(kResetDropAndDeleteUnsynced, + num_pre_sync, num_post_sync); + } + NoWriteTestPreFault(); + NoWriteTestReopenWithFault(kResetDropAndDeleteUnsynced); + + PartialCompactTestPreFault(num_pre_sync, num_post_sync); + // No new files created so we expect all values since no files will be + // dropped. + // WAL Dir is not synced for now. + if (option_config_ != kWalDir && option_config_ != kWalDirSyncWal) { + PartialCompactTestReopenWithFault(kResetDeleteUnsyncedFiles, + num_pre_sync + num_post_sync, 0); + } + NoWriteTestPreFault(); + NoWriteTestReopenWithFault(kResetDeleteUnsyncedFiles); } - NoWriteTestPreFault(); - NoWriteTestReopenWithFault(kResetDeleteUnsyncedFiles); } } while (ChangeOptions()); }