diff options
Diffstat (limited to 'jstests/replsets/replset1.js')
-rw-r--r-- | jstests/replsets/replset1.js | 22 |
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 ); } |