summaryrefslogtreecommitdiff
path: root/jstests/replsets/replset2.js
diff options
context:
space:
mode:
authorKyle Banker <kylebanker@gmail.com>2010-08-26 12:13:08 -0400
committerKyle Banker <kylebanker@gmail.com>2010-08-26 12:13:08 -0400
commitd11ec32d5e19cb067d477787f475162b51a7b553 (patch)
treefb804e087e264fa932190df19a7518571657cb24 /jstests/replsets/replset2.js
parentfb72d4b0e361dee77889df200e963fdb1933b829 (diff)
downloadmongo-d11ec32d5e19cb067d477787f475162b51a7b553.tar.gz
increase oplog size and better debugging for replset2.js test
Diffstat (limited to 'jstests/replsets/replset2.js')
-rw-r--r--jstests/replsets/replset2.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/jstests/replsets/replset2.js b/jstests/replsets/replset2.js
index d9b19be105b..4f5d7fb5ebd 100644
--- a/jstests/replsets/replset2.js
+++ b/jstests/replsets/replset2.js
@@ -9,7 +9,7 @@ doTest = function (signal) {
// Replica set testing API
// Create a new replica set test. Specify set name and the number of nodes you want.
- var replTest = new ReplSetTest({ name: 'testSet', nodes: 3 });
+ var replTest = new ReplSetTest({ name: 'testSet', nodes: 3, oplogSize: 5 });
// call startSet() to start each mongod in the replica set
// this returns a list of nodes
@@ -99,6 +99,7 @@ doTest = function (signal) {
// Test getlasterror with large insert
print("replset2.js **** Try inserting many records ****")
+ try {
bigData = new Array(2000).toString()
for (var n = 0; n < 1000; n++) {
master.getDB(testDB).baz.insert({ n: n, data: bigData });
@@ -121,6 +122,17 @@ doTest = function (signal) {
verifyReplication("slave 1", slaves[1].getDB(testDB).baz);
assert(failed == false, "replset2.js Replication with getLastError failed. See errors.");
+ }
+ catch(e) {
+ print("ERROR: " + e);
+ print("Master oplog findOne:");
+ printjson(master.getDB("local").oplog.rs.find().sort({"$natural": -1}).limit(1).next());
+ print("Slave 0 oplog findOne:");
+ printjson(slaves[0].getDB("local").oplog.rs.find().sort({"$natural": -1}).limit(1).next());
+ print("Slave 1 oplog findOne:");
+ printjson(slaves[1].getDB("local").oplog.rs.find().sort({"$natural": -1}).limit(1).next());
+ }
+
replTest.stopSet(signal);
}