Implemented recovery and tests.

Summary: Implemented durability recovery and tesats.

Reviewers: mislav.bradac, dgleich, buda

Reviewed By: mislav.bradac, dgleich, buda

Subscribers: dtomicevic, mferencevic, pullbot

Differential Revision: https://phabricator.memgraph.io/D374
This commit is contained in:
matej.gradicek
2017-06-06 15:04:49 +00:00
parent 7278bdff94
commit 15b57e2d52
16 changed files with 684 additions and 34 deletions

View File

@@ -95,6 +95,18 @@ TEST_F(SnapshotTest, CreateSnapshotWithUnlimitedMaxRetainedSnapshots) {
EXPECT_EQ(files.size(), 10);
}
TEST_F(SnapshotTest, TestSnapshotFileOnDbDestruct) {
{
CONFIG(config::SNAPSHOTS_PATH) = SNAPSHOTS_FOLDER_ALL_DB;
CONFIG(config::SNAPSHOT_DB_DESTRUCTION) = "true";
Dbms dbms;
auto dba = dbms.active();
}
std::vector<fs::path> files = GetFilesFromDir(SNAPSHOTS_TEST_DEFAULT_DB_DIR);
// snapshot is created on dbms destruction
EXPECT_EQ(files.size(), 1);
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();