Skip to content

Commit

Permalink
MB-45408: Use single config string for persistentConfigValues()
Browse files Browse the repository at this point in the history
This requires tweaking various tests to deal with the
parameterization.

Change-Id: I3bad02d8fdb44f5960430fd1be48926bf26149bb
Reviewed-on: https://review.couchbase.org/c/kv_engine/+/171520
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
BenHuddleston authored and daverigby committed Mar 1, 2022
1 parent dfa548b commit 82e5a33
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
Expand Up @@ -2899,8 +2899,8 @@ TEST_P(CollectionsPersistentParameterizedTest, PerCollectionDiskSizeRollback) {
*/
StatChecker::PostFunc getPrepareStatCheckerPostFuncForBackend(
std::string backend, StatChecker::PostFunc fn) {
if (backend.find("persistent_magma") != std::string::npos ||
backend.find("nexus_magma") != std::string::npos) {
if (backend.find(":backend=magma") != std::string::npos ||
backend.find("nexus_primary_backend=magma") != std::string::npos) {
// Magma doesn't currently track prepares as we remove them during
// compaction and we don't know if we are removing a stale one or not,
// making it impossible to count them accurately. As such we also cannot
Expand Down
36 changes: 28 additions & 8 deletions engines/ep/tests/module_tests/evp_store_single_threaded_test.h
Expand Up @@ -533,16 +533,36 @@ class STParameterizedBucketTest
static auto persistentConfigValues() {
using namespace std::string_literals;
return ::testing::Values(
std::make_tuple("persistent_couchstore"s, "value_only"s),
std::make_tuple("persistent_couchstore"s, "full_eviction"s)
std::make_tuple("bucket_type=persistent:"
"backend=couchstore:"
"item_eviction_policy=value_only"s,
""s),
std::make_tuple("bucket_type=persistent:"
"backend=couchstore:"
"item_eviction_policy=full_eviction"s,
""s)
#ifdef EP_USE_MAGMA
,
std::make_tuple("persistent_nexus_couchstore_magma"s,
"value_only"),
std::make_tuple("persistent_nexus_couchstore_magma"s,
"full_eviction"),
std::make_tuple("persistent_magma"s, "value_only"s),
std::make_tuple("persistent_magma"s, "full_eviction"s)
std::make_tuple("bucket_type=persistent:"
"backend=nexus:"
"nexus_primary_backend=couchstore:"
"nexus_secondary_backend=magma:"
"item_eviction_policy=value_only"s,
""s),
std::make_tuple("bucket_type=persistent:"
"backend=nexus:"
"nexus_primary_backend=couchstore:"
"nexus_secondary_backend=magma:"
"item_eviction_policy=full_eviction"s,
""s),
std::make_tuple("bucket_type=persistent:"
"backend=magma:"
"item_eviction_policy=value_only"s,
""s),
std::make_tuple("bucket_type=persistent:"
"backend=magma:"
"item_eviction_policy=full_eviction"s,
""s)
#endif
);
}
Expand Down
7 changes: 3 additions & 4 deletions engines/ep/tests/module_tests/item_pager_test.cc
Expand Up @@ -2321,12 +2321,11 @@ TEST_P(MB_36087, DelWithMeta_EvictedKey) {
runBGFetcherTask();

// Full eviction first did a meta-fetch, now has todo a full fetch
auto err = std::get<1>(GetParam()) == "full_eviction"
? cb::engine_errc::would_block
: cb::engine_errc::success;
auto err = fullEviction() ? cb::engine_errc::would_block
: cb::engine_errc::success;
EXPECT_EQ(err, deleteWithMeta());

if (std::get<1>(GetParam()) == "full_eviction") {
if (fullEviction()) {
runBGFetcherTask();
EXPECT_EQ(cb::engine_errc::success, deleteWithMeta());
}
Expand Down

0 comments on commit 82e5a33

Please sign in to comment.