Test use_mmap_reads

Summary: We currently don't test mmap reads as part of db_test. Piggyback it on kWalDir test config.

Test Plan: make check

Reviewers: ljin, sdong, yhchiang

Reviewed By: yhchiang

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D23337
This commit is contained in:
Igor Canadi 2014-09-17 12:31:53 -07:00
parent 94e43a1dfe
commit 60a4aa175e

View File

@ -342,7 +342,7 @@ class DBTest {
kUncompressed = 11, kUncompressed = 11,
kNumLevel_3 = 12, kNumLevel_3 = 12,
kDBLogDir = 13, kDBLogDir = 13,
kWalDir = 14, kWalDirAndMmapReads = 14,
kManifestFileSize = 15, kManifestFileSize = 15,
kCompactOnFlush = 16, kCompactOnFlush = 16,
kPerfOptions = 17, kPerfOptions = 17,
@ -377,6 +377,7 @@ class DBTest {
kSkipNoSeekToLast = 32, kSkipNoSeekToLast = 32,
kSkipHashCuckoo = 64, kSkipHashCuckoo = 64,
kSkipFIFOCompaction = 128, kSkipFIFOCompaction = 128,
kSkipMmapReads = 256,
}; };
@ -436,6 +437,10 @@ class DBTest {
option_config_ == kFIFOCompaction) { option_config_ == kFIFOCompaction) {
continue; continue;
} }
if ((skip_mask & kSkipMmapReads) &&
option_config_ == kWalDirAndMmapReads) {
continue;
}
break; break;
} }
@ -539,8 +544,11 @@ class DBTest {
case kDBLogDir: case kDBLogDir:
options.db_log_dir = test::TmpDir(); options.db_log_dir = test::TmpDir();
break; break;
case kWalDir: case kWalDirAndMmapReads:
options.wal_dir = test::TmpDir() + "/wal"; options.wal_dir = test::TmpDir() + "/wal";
// mmap reads should be orthogonal to WalDir setting, so we piggyback to
// this option config to test mmap reads as well
options.allow_mmap_reads = true;
break; break;
case kManifestFileSize: case kManifestFileSize:
options.max_manifest_file_size = 50; // 50 bytes options.max_manifest_file_size = 50; // 50 bytes
@ -1675,8 +1683,8 @@ TEST(DBTest, NonBlockingIteration) {
// This test verifies block cache behaviors, which is not used by plain // This test verifies block cache behaviors, which is not used by plain
// table format. // table format.
// Exclude kHashCuckoo as it does not support iteration currently // Exclude kHashCuckoo as it does not support iteration currently
} while (ChangeOptions(kSkipPlainTable | kSkipNoSeekToLast | } while (ChangeOptions(kSkipPlainTable | kSkipNoSeekToLast | kSkipHashCuckoo |
kSkipHashCuckoo)); kSkipMmapReads));
} }
// A delete is skipped for key if KeyMayExist(key) returns False // A delete is skipped for key if KeyMayExist(key) returns False