summaryrefslogtreecommitdiff
path: root/jstests/replsets/replset1.js
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-09-14 17:08:06 +0200
committerAntonin Kral <a.kral@bobek.cz>2011-09-14 17:08:06 +0200
commit5d342a758c6095b4d30aba0750b54f13b8916f51 (patch)
tree762e9aa84781f5e3b96db2c02d356c29cf0217c0 /jstests/replsets/replset1.js
parentcbe2d992e9cd1ea66af9fa91df006106775d3073 (diff)
downloadmongodb-5d342a758c6095b4d30aba0750b54f13b8916f51.tar.gz
Imported Upstream version 2.0.0
Diffstat (limited to 'jstests/replsets/replset1.js')
-rw-r--r--jstests/replsets/replset1.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/replsets/replset1.js b/jstests/replsets/replset1.js
index 5ac94e7..6387c5d 100644
--- a/jstests/replsets/replset1.js
+++ b/jstests/replsets/replset1.js
@@ -108,6 +108,28 @@ doTest = function( signal ) {
assert.eq( 1000 , count.n , "slave count wrong: " + slave );
});
+ // last error
+ master = replTest.getMaster();
+ slaves = replTest.liveNodes.slaves;
+ printjson(replTest.liveNodes);
+
+ db = master.getDB("foo")
+ t = db.foo
+
+ ts = slaves.map( function(z){ z.setSlaveOk(); return z.getDB( "foo" ).foo; } )
+
+ t.save({a: 1000});
+ t.ensureIndex( { a : 1 } )
+
+ db.getLastError( 3 , 30000 )
+
+ ts.forEach( function(z){ assert.eq( 2 , z.getIndexKeys().length , "A " + z.getMongo() ); } )
+
+ t.reIndex()
+
+ db.getLastError( 3 , 30000 )
+ ts.forEach( function(z){ assert.eq( 2 , z.getIndexKeys().length , "A " + z.getMongo() ); } )
+
// Shut down the set and finish the test.
replTest.stopSet( signal );
}