1
0
Fork 0

move engine-specific test into engine test

This commit is contained in:
jsteemann 2017-05-02 11:24:01 +02:00
parent 3a19370978
commit 8a9dd4e35a
2 changed files with 47 additions and 48 deletions

View File

@ -277,7 +277,6 @@ function ReplicationSuite() {
function(state) {
// data loss on slave!
require('console').log('count: ', db._collection(cn).count());
assertTrue(db._collection(cn).count() < 25);
}, {
requireFromPresent: false,
@ -285,6 +284,53 @@ function ReplicationSuite() {
}
);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test require from present
////////////////////////////////////////////////////////////////////////////////
testRequireFromPresentTrue : function () {
connectToMaster();
compare(
function (state) {
db._create(cn);
},
function (state) {
// flush the wal logs on the master so the start tick is not available
// anymore when we start replicating
for (var i = 0; i < 30; ++i) {
db._collection(cn).save({ value: i });
internal.wal.flush(); //true, true);
}
internal.wal.flush(true, true);
internal.wait(6, false);
state.checksum = collectionChecksum(cn);
state.count = collectionCount(cn);
assertEqual(30, state.count);
},
function (state) {
// wait for slave applier to have started and run
internal.wait(5, false);
// slave should not have stopped
assertTrue(replication.applier.state().state.running);
return true;
},
function (state) {
assertEqual(state.count, collectionCount(cn));
assertEqual(state.checksum, collectionChecksum(cn));
},
{
requireFromPresent: true,
keepBarrier: true
}
);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test require from present, no barrier

View File

@ -418,53 +418,6 @@ function ReplicationSuite() {
);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test require from present
////////////////////////////////////////////////////////////////////////////////
testRequireFromPresentTrue : function () {
connectToMaster();
compare(
function (state) {
db._create(cn);
},
function (state) {
// flush the wal logs on the master so the start tick is not available
// anymore when we start replicating
for (var i = 0; i < 30; ++i) {
db._collection(cn).save({ value: i });
internal.wal.flush(); //true, true);
}
internal.wal.flush(true, true);
internal.wait(6, false);
state.checksum = collectionChecksum(cn);
state.count = collectionCount(cn);
assertEqual(30, state.count);
},
function (state) {
// wait for slave applier to have started and run
internal.wait(5, false);
// slave should not have stopped
assertTrue(replication.applier.state().state.running);
return true;
},
function (state) {
assertEqual(state.count, collectionCount(cn));
assertEqual(state.checksum, collectionChecksum(cn));
},
{
requireFromPresent: true,
keepBarrier: true
}
);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test long transaction, blocking
////////////////////////////////////////////////////////////////////////////////