Fix build failing becasue of ttl-keymayexist

Summary: PutValues calls Flush in ttl_test which clears memtables. KeyMayExist called after that will not be able to read those key-values

Test Plan: make all check OPT=-g

Reviewers:leveldb
main
Mayank Agarwal 11 years ago
parent c34271a5a5
commit b1d09f1a51
  1. 8
      utilities/ttl/ttl_test.cc

@ -119,7 +119,7 @@ class TtlTest {
}
// Puts num_entries starting from start_pos_map from kvmap_ into the database
void PutValues(int start_pos_map, int num_entries) {
void PutValues(int start_pos_map, int num_entries, bool flush = true) {
assert(db_ttl_);
ASSERT_LE(start_pos_map + num_entries, (int)kvmap_.size());
static WriteOptions wopts;
@ -131,7 +131,9 @@ class TtlTest {
}
// Put a mock kv at the end because CompactionFilter doesn't delete last key
ASSERT_OK(db_ttl_->Put(wopts, "keymock", "valuemock"));
db_ttl_->Flush(flush_opts);
if (flush) {
db_ttl_->Flush(flush_opts);
}
}
// Runs a manual compaction
@ -487,7 +489,7 @@ TEST(TtlTest, KeyMayExist) {
MakeKVMap(kSampleSize_);
OpenTtl();
PutValues(0, kSampleSize_);
PutValues(0, kSampleSize_, false);
SimpleKeyMayExistCheck();

Loading…
Cancel
Save