Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
#include "mvcc_find_update_common.hpp"
|
|
|
|
|
2017-06-02 15:19:23 +08:00
|
|
|
#undef T4_FIND
|
|
|
|
#define T4_FIND version_list.find(*t4)
|
2017-10-18 22:03:06 +08:00
|
|
|
#undef T3_FIND
|
|
|
|
#define T3_FIND version_list.find(*t3)
|
2017-06-02 15:19:23 +08:00
|
|
|
|
|
|
|
// IMPORTANT: look definiton of EXPECT_CRE and EXPECT_EXP macros in
|
|
|
|
// tests/mvcc_find_update_common.hpp. Numbers in those macros represent
|
|
|
|
// transaction ids when transactions where created.
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
// ****************************************************************
|
|
|
|
// * CASE 1: T3 starts after T2 ends.
|
|
|
|
// *
|
|
|
|
// * T2: START---OP---END
|
|
|
|
// *
|
|
|
|
// * T3: START---OP---END
|
|
|
|
// *
|
2017-05-29 16:38:07 +08:00
|
|
|
// * T4: START---FIND---END
|
2017-05-16 18:22:28 +08:00
|
|
|
// ****************************************************************
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdCmtUpdCmt1) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_COMMIT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 3);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v3, v2);
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_SIZE(3);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v3);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdCmtRemCmt1) {
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T2_UPDATE;
|
|
|
|
T2_COMMIT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_COMMIT;
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v2, 2);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
EXPECT_EXP(v2, 3);
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, nullptr);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
}
|
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, RemCmtUpdCmt1) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_COMMIT;
|
|
|
|
T3_BEGIN;
|
|
|
|
EXPECT_DEATH(T3_UPDATE, ".*nullptr.*");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemCmtRemCmt1) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_COMMIT;
|
|
|
|
T3_BEGIN;
|
2017-10-18 22:03:06 +08:00
|
|
|
EXPECT_FALSE(T3_FIND);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdCmtUpdAbt1) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_COMMIT;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
2017-05-16 18:22:28 +08:00
|
|
|
T3_ABORT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 3);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_NXT(v3, v2);
|
|
|
|
EXPECT_SIZE(3);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v2);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
}
|
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, UpdCmtRemAbt1) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_COMMIT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_ABORT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 3);
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v2);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemCmtUpdAbt1) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_COMMIT;
|
|
|
|
T3_BEGIN;
|
|
|
|
EXPECT_DEATH(T3_UPDATE, ".*nullptr.*");
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemCmtRemAbt1) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_COMMIT;
|
|
|
|
T3_BEGIN;
|
2017-10-18 22:03:06 +08:00
|
|
|
EXPECT_FALSE(T3_FIND);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdAbtUpdCmt1) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_ABORT;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_COMMIT;
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v3, v2);
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_SIZE(3);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v3);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
}
|
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, UpdAbtRemCmt1) {
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T2_UPDATE;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_COMMIT;
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, nullptr);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, RemAbtUpdCmt1) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v3, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v3);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemAbtRemCmt1) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_SIZE(1);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, nullptr);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdAbtUpdAbt1) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_ABORT;
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_NXT(v3, v2);
|
|
|
|
EXPECT_SIZE(3);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdAbtRemAbt1) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_ABORT;
|
|
|
|
EXPECT_NXT(v2, v1);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
}
|
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, RemAbtUpdAbt1) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_ABORT;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_ABORT;
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v3, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemAbtRemAbt1) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_ABORT;
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_SIZE(1);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ****************************************************************
|
|
|
|
// * CASE 2: T3 starts before T2 ends.
|
|
|
|
// *
|
|
|
|
// * T2: START---OP---END
|
|
|
|
// *
|
|
|
|
// * T3: START---------OP---END
|
|
|
|
// *
|
2017-05-29 16:38:07 +08:00
|
|
|
// * T4: START---FIND---END
|
|
|
|
// *
|
2017-05-16 18:22:28 +08:00
|
|
|
// ****************************************************************
|
|
|
|
|
|
|
|
// ****************************
|
|
|
|
// COVERS 8 cases!
|
|
|
|
TEST_F(Mvcc, UpdCmtUpd2) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_COMMIT;
|
|
|
|
EXPECT_THROW(T3_UPDATE, mvcc::SerializationError);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdCmtRem2) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_COMMIT;
|
|
|
|
EXPECT_THROW(T3_REMOVE, mvcc::SerializationError);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemCmtUpd2) {
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T2_REMOVE;
|
2017-05-16 18:22:28 +08:00
|
|
|
T3_BEGIN;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T2_COMMIT;
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_THROW(T3_UPDATE, mvcc::SerializationError);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemCmtRem2) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_COMMIT;
|
|
|
|
EXPECT_THROW(T3_REMOVE, mvcc::SerializationError);
|
|
|
|
}
|
|
|
|
// **************************
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdAbtUpdCmt2) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_NXT(v3, v2);
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_SIZE(3);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v3);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
}
|
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, UpdAbtRemCmt2) {
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T2_UPDATE;
|
2017-05-16 18:22:28 +08:00
|
|
|
T3_BEGIN;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T2_ABORT;
|
2017-05-16 18:22:28 +08:00
|
|
|
T3_REMOVE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, nullptr);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemAbtUpdCmt2) {
|
|
|
|
T2_REMOVE;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T3_BEGIN;
|
2017-05-16 18:22:28 +08:00
|
|
|
T2_ABORT;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T3_UPDATE;
|
|
|
|
T3_COMMIT;
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v3, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v3);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, RemAbtRemCmt2) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_SIZE(1);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, nullptr);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdAbtUpdAbt2) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_ABORT;
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_NXT(v3, v2);
|
|
|
|
EXPECT_SIZE(3);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdAbtRemAbt2) {
|
|
|
|
T2_UPDATE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_ABORT;
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemAbtUpdAbt2) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_ABORT;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_NXT(v3, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemAbtRemAbt2) {
|
|
|
|
T2_REMOVE;
|
|
|
|
T3_BEGIN;
|
|
|
|
T2_ABORT;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_ABORT;
|
|
|
|
EXPECT_EXP(v1, 3);
|
|
|
|
EXPECT_SIZE(1);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// ****************************************************************
|
|
|
|
// * CASE 3: T3 ends before T2 starts executing operations.
|
|
|
|
// *
|
|
|
|
// * T2: START--------------------OP---END
|
|
|
|
// *
|
|
|
|
// * T3: START---OP---END
|
|
|
|
// *
|
2017-05-29 16:38:07 +08:00
|
|
|
// * T4: START---FIND---END
|
|
|
|
// *
|
2017-05-16 18:22:28 +08:00
|
|
|
// ****************************************************************
|
|
|
|
|
|
|
|
// ****************************
|
|
|
|
// COVERS 8 cases!
|
|
|
|
TEST_F(Mvcc, UpdUpdCmt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_THROW(T2_UPDATE, mvcc::SerializationError);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdRemCmt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_THROW(T2_UPDATE, mvcc::SerializationError);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
}
|
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, RemUpdCmt3) {
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
2017-05-16 18:22:28 +08:00
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_THROW(T2_REMOVE, mvcc::SerializationError);
|
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemRemCmt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_COMMIT;
|
|
|
|
EXPECT_THROW(T2_REMOVE, mvcc::SerializationError);
|
|
|
|
}
|
|
|
|
// **************************
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdCmtUpdAbt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_ABORT;
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_COMMIT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v3, v1);
|
|
|
|
EXPECT_NXT(v2, v3);
|
|
|
|
EXPECT_SIZE(3);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v2);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdCmtRemAbt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T3_ABORT;
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_COMMIT;
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v2);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemCmtUpdAbt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_ABORT;
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_COMMIT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v3, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, nullptr);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemCmtRemAbt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_ABORT;
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_COMMIT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_SIZE(1);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, nullptr);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, UpdAbtUpdAbt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
|
|
|
T3_ABORT;
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_ABORT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_NXT(v3, v1);
|
|
|
|
EXPECT_NXT(v2, v3);
|
|
|
|
EXPECT_SIZE(3);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, UpdAbtRemAbt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_ABORT;
|
|
|
|
T2_UPDATE;
|
|
|
|
T2_ABORT;
|
|
|
|
EXPECT_NXT(v2, v1);
|
|
|
|
EXPECT_EXP(v1, 2);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
EXPECT_CRE(v2, 2);
|
|
|
|
EXPECT_EXP(v2, 0);
|
2017-05-16 18:22:28 +08:00
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
}
|
|
|
|
|
2017-05-16 18:22:28 +08:00
|
|
|
TEST_F(Mvcc, RemAbtUpdAbt3) {
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
T3_BEGIN;
|
|
|
|
T3_UPDATE;
|
2017-05-16 18:22:28 +08:00
|
|
|
T3_ABORT;
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_ABORT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_CRE(v3, 3);
|
|
|
|
EXPECT_EXP(v3, 0);
|
|
|
|
EXPECT_NXT(v3, v1);
|
|
|
|
EXPECT_SIZE(2);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
2017-05-16 18:22:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
TEST_F(Mvcc, RemAbtRemAbt3) {
|
|
|
|
T3_BEGIN;
|
|
|
|
T3_REMOVE;
|
|
|
|
T3_ABORT;
|
|
|
|
T2_REMOVE;
|
|
|
|
T2_ABORT;
|
|
|
|
EXPECT_EXP(v1, 2);
|
|
|
|
EXPECT_SIZE(1);
|
2017-05-29 16:38:07 +08:00
|
|
|
T4_BEGIN;
|
|
|
|
EXPECT_EQ(T4_FIND, v1);
|
Mvcc - unit test infrastructure setup
Summary:
Gradicek's Mvcc test have seen the following changes:
- provided a test infrastructure (fixture and macros) to facilitate testing and increase readability
- split tests into multi-transaction update, VersionList::find and general Mvcc testing
- multi-transaction update tests have been refactored (i *think* nothing got deleted, but it was a mess so I don't guarantee)
- changed all multithreaded tests to be single-threaded because multiple threads were not necessary
- changed transaction naming from T5, T8, T10 to T1, T2... for consistency with actual transaction indices
What still needs to be done:
- Gleich and Gradicek need to review the infrastructure (possible improvements)
- multi-transaction update tests need to be addressed by Gradicek (see "TODO gradicek" in code, discuss with Flor)
- the wiki/draw.io documentation needs to be updated. it is not imperative that all the tests be drawn in draw.io, only the general infrastructure explained. perhaps only a few examples drawn. Gradicek discuss with Flor
- Gleich see the "TODO Gleich" lines in the diff and discuss with flor
Suggested workflow:
- review this diff, hopefully land (before resolving all the TODOs)
- discard D169
- Gradicek and Gleich address the TODOs
- Flor reviews the results (in following diffs)
Reviewers: dgleich, matej.gradicek, buda
Reviewed By: matej.gradicek, buda
Subscribers: pullbot
Differential Revision: https://phabricator.memgraph.io/D348
2017-05-05 17:05:56 +08:00
|
|
|
}
|
2017-10-16 22:24:47 +08:00
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
::testing::FLAGS_gtest_death_test_style = "threadsafe";
|
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
}
|