Skip to content

Commit

Permalink
fix IteratorsConsistentView tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jaykorean committed Apr 25, 2024
1 parent 1fca175 commit f05bb3a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions db/db_iterator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3592,9 +3592,6 @@ TEST_F(DBIteratorTest, IteratorsConsistentViewImplicitSnapshot) {
ASSERT_EQ(IterStatus(iter), "cf" + std::to_string(i) + "_key->cf" +
std::to_string(i) + "_val_new");
}
for (auto* iter : iters) {
delete iter;
}

// Thread-local SVs are no longer obsolete nor in use
for (int i = 0; i < 3; ++i) {
Expand All @@ -3603,6 +3600,10 @@ TEST_F(DBIteratorTest, IteratorsConsistentViewImplicitSnapshot) {
ASSERT_NE(cfd->TEST_GetLocalSV()->Get(), SuperVersion::kSVObsolete);
ASSERT_NE(cfd->TEST_GetLocalSV()->Get(), SuperVersion::kSVInUse);
}

for (auto* iter : iters) {
delete iter;
}
}

TEST_F(DBIteratorTest, IteratorsConsistentViewExplicitSnapshot) {
Expand Down Expand Up @@ -3647,10 +3648,7 @@ TEST_F(DBIteratorTest, IteratorsConsistentViewExplicitSnapshot) {
std::to_string(i) + "_val");
}

db_->ReleaseSnapshot(snapshot);
for (auto* iter : iters) {
delete iter;
}
sleep(3);

// Thread-local SV for cf_0 is obsolete (flush happened after the first SV
// Ref)
Expand All @@ -3666,6 +3664,11 @@ TEST_F(DBIteratorTest, IteratorsConsistentViewExplicitSnapshot) {
ASSERT_NE(cfd->TEST_GetLocalSV()->Get(), SuperVersion::kSVObsolete);
ASSERT_NE(cfd->TEST_GetLocalSV()->Get(), SuperVersion::kSVInUse);
}

db_->ReleaseSnapshot(snapshot);
for (auto* iter : iters) {
delete iter;
}
}

} // namespace ROCKSDB_NAMESPACE
Expand Down

0 comments on commit f05bb3a

Please sign in to comment.