Skip to content

Commit 60a4aa1

Browse files
committed
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
1 parent 94e43a1 commit 60a4aa1

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

db/db_test.cc

+12-4
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class DBTest {
342342
kUncompressed = 11,
343343
kNumLevel_3 = 12,
344344
kDBLogDir = 13,
345-
kWalDir = 14,
345+
kWalDirAndMmapReads = 14,
346346
kManifestFileSize = 15,
347347
kCompactOnFlush = 16,
348348
kPerfOptions = 17,
@@ -377,6 +377,7 @@ class DBTest {
377377
kSkipNoSeekToLast = 32,
378378
kSkipHashCuckoo = 64,
379379
kSkipFIFOCompaction = 128,
380+
kSkipMmapReads = 256,
380381
};
381382

382383

@@ -436,6 +437,10 @@ class DBTest {
436437
option_config_ == kFIFOCompaction) {
437438
continue;
438439
}
440+
if ((skip_mask & kSkipMmapReads) &&
441+
option_config_ == kWalDirAndMmapReads) {
442+
continue;
443+
}
439444
break;
440445
}
441446

@@ -539,8 +544,11 @@ class DBTest {
539544
case kDBLogDir:
540545
options.db_log_dir = test::TmpDir();
541546
break;
542-
case kWalDir:
547+
case kWalDirAndMmapReads:
543548
options.wal_dir = test::TmpDir() + "/wal";
549+
// mmap reads should be orthogonal to WalDir setting, so we piggyback to
550+
// this option config to test mmap reads as well
551+
options.allow_mmap_reads = true;
544552
break;
545553
case kManifestFileSize:
546554
options.max_manifest_file_size = 50; // 50 bytes
@@ -1675,8 +1683,8 @@ TEST(DBTest, NonBlockingIteration) {
16751683
// This test verifies block cache behaviors, which is not used by plain
16761684
// table format.
16771685
// Exclude kHashCuckoo as it does not support iteration currently
1678-
} while (ChangeOptions(kSkipPlainTable | kSkipNoSeekToLast |
1679-
kSkipHashCuckoo));
1686+
} while (ChangeOptions(kSkipPlainTable | kSkipNoSeekToLast | kSkipHashCuckoo |
1687+
kSkipMmapReads));
16801688
}
16811689

16821690
// A delete is skipped for key if KeyMayExist(key) returns False

0 commit comments

Comments
 (0)