Fix DB configuration error under expansion gbench (#1368)

This commit is contained in:
andrejtonev 2023-10-16 23:12:49 +02:00 committed by GitHub
parent 64bf75117b
commit a100b900c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,15 +21,19 @@
#include "storage/v2/isolation_level.hpp" #include "storage/v2/isolation_level.hpp"
#include "utils/logging.hpp" #include "utils/logging.hpp"
std::filesystem::path data_directory{std::filesystem::temp_directory_path() / "expansion-benchmark"};
class ExpansionBenchFixture : public benchmark::Fixture { class ExpansionBenchFixture : public benchmark::Fixture {
protected: protected:
std::optional<memgraph::query::InterpreterContext> interpreter_context; std::optional<memgraph::query::InterpreterContext> interpreter_context;
std::optional<memgraph::query::Interpreter> interpreter; std::optional<memgraph::query::Interpreter> interpreter;
std::filesystem::path data_directory{std::filesystem::temp_directory_path() / "expansion-benchmark"}; std::optional<memgraph::utils::Gatekeeper<memgraph::dbms::Database>> db_gk;
std::optional<memgraph::utils::Gatekeeper<memgraph::dbms::Database>> db_gk{memgraph::storage::Config{
.durability.storage_directory = data_directory, .disk.main_storage_directory = data_directory / "disk"}};
void SetUp(const benchmark::State &state) override { void SetUp(const benchmark::State &state) override {
memgraph::storage::Config config{};
config.durability.storage_directory = data_directory;
config.disk.main_storage_directory = data_directory / "disk";
db_gk.emplace(std::move(config));
auto db_acc_opt = db_gk->access(); auto db_acc_opt = db_gk->access();
MG_ASSERT(db_acc_opt, "Failed to access db"); MG_ASSERT(db_acc_opt, "Failed to access db");
auto &db_acc = *db_acc_opt; auto &db_acc = *db_acc_opt;