diff --git a/js/server/tests/replication/replication-ongoing-mmfiles.js b/js/server/tests/replication/replication-ongoing-mmfiles.js index 0395628cab..8ad8f70152 100644 --- a/js/server/tests/replication/replication-ongoing-mmfiles.js +++ b/js/server/tests/replication/replication-ongoing-mmfiles.js @@ -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 diff --git a/js/server/tests/replication/replication-ongoing.js b/js/server/tests/replication/replication-ongoing.js index ca7f9bc238..96e5c7aec4 100644 --- a/js/server/tests/replication/replication-ongoing.js +++ b/js/server/tests/replication/replication-ongoing.js @@ -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 ////////////////////////////////////////////////////////////////////////////////