Skip to content

Commit

Permalink
MB-45408: Remove unnecessary GetParam() calls
Browse files Browse the repository at this point in the history
We should rely on engine config instead where appropriate

Change-Id: I356aece53c1792aaad4341989d9583a67e46afa8
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/171522
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
BenHuddleston authored and daverigby committed Mar 2, 2022
1 parent aaf7eff commit 5f3b613
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
Expand Up @@ -211,7 +211,6 @@ void DurabilityActiveStreamTest::testSendCompleteSyncWrite(Resolution res) {
// following indirectly calls VBucket::commit
simulateStreamSeqnoAck(replica, prepareSeqno);
// Note: At FE we have an exact item count only at persistence.
auto evictionType = std::get<1>(GetParam());
if (ephemeral() || !fullEviction()) {
EXPECT_EQ(1, vb->getNumItems());
} else {
Expand Down
2 changes: 0 additions & 2 deletions engines/ep/tests/module_tests/evp_store_durability_test.cc
Expand Up @@ -1394,7 +1394,6 @@ void DurabilityEPBucketTest::verifyOnDiskItemCount(VBucket& vb,
uint64_t expectedValue) {
// skip for rocksdb as it treats every mutation as an insertion
// and so we would expect a different item count compared with couchstore
auto bucketType = std::get<0>(GetParam());
if (isRocksDB()) {
return;
}
Expand All @@ -1405,7 +1404,6 @@ void DurabilityEPBucketTest::verifyCollectionItemCount(VBucket& vb,
CollectionID cID,
uint64_t expectedValue) {
// skip for rocksdb as it dose not perform item counting for collections
auto bucketType = std::get<0>(GetParam());
if (isRocksDB()) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions engines/ep/tests/module_tests/evp_store_warmup_test.cc
Expand Up @@ -1091,8 +1091,8 @@ void DurabilityWarmupTest::testCommittedAndPendingSyncWrite(
auto vb = engine->getVBucket(vbid);
// @TODO: RocksDB currently only has an estimated item count in
// full-eviction, so it fails this check. Skip if RocksDB && full_eviction.
if ((!isRocksDB()) || std::get<0>(GetParam()) == "value_only") {
EXPECT_EQ(1, vb->getNumTotalItems());
if (!isRocksDB() || !fullEviction()) {
EXPECT_EQ(1, vb->getNumItems());
}
EXPECT_EQ(1, vb->ht.getNumPreparedSyncWrites());

Expand Down Expand Up @@ -1178,7 +1178,7 @@ TEST_P(DurabilityWarmupTest, AbortedSyncWritePrepareIsNotLoaded) {
auto vb = engine->getVBucket(vbid);
// @TODO: RocksDB currently only has an estimated item count in
// full-eviction, so it fails this check. Skip if RocksDB && full_eviction.
if (!isRocksDB() || std::get<0>(GetParam()) == "value_only") {
if (!isRocksDB() || !fullEviction()) {
EXPECT_EQ(1, vb->getNumItems());
}
EXPECT_EQ(0, vb->ht.getNumPreparedSyncWrites());
Expand Down
6 changes: 3 additions & 3 deletions engines/ep/tests/module_tests/item_pager_test.cc
Expand Up @@ -775,7 +775,7 @@ TEST_P(STItemPagerTest, test_memory_limit) {
ASSERT_EQ(cb::engine_errc::success, storeItem(item));
}

if (std::get<0>(GetParam()) == "persistent") {
if (persistent()) {
// flush so the HT item becomes clean
flush_vbucket_to_disk(vbid);

Expand Down Expand Up @@ -817,11 +817,11 @@ TEST_P(STItemPagerTest, test_memory_limit) {
// item_pager should be notified and ready to run
runHighMemoryPager();

if (std::get<0>(GetParam()) == "persistent") {
if (persistent()) {
EXPECT_EQ(1, stats.numValueEjects);
}

if (std::get<1>(GetParam()) != "fail_new_data") {
if (ephemeralFailNewData()) {
// Enough should of been freed so itemAllocate can succeed
auto [status, item] =
engine->itemAllocate({"key2", DocKeyEncodesCollectionId::No},
Expand Down

0 comments on commit 5f3b613

Please sign in to comment.