summaryrefslogtreecommitdiff
path: root/jstests/replsets/randomcommands1.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/replsets/randomcommands1.js')
-rw-r--r--jstests/replsets/randomcommands1.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/jstests/replsets/randomcommands1.js b/jstests/replsets/randomcommands1.js
new file mode 100644
index 0000000..c451e74
--- /dev/null
+++ b/jstests/replsets/randomcommands1.js
@@ -0,0 +1,29 @@
+
+replTest = new ReplSetTest( {name: 'randomcommands1', nodes: 3} );
+
+nodes = replTest.startSet();
+replTest.initiate();
+
+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() ); } )
+
+replTest.stopSet( 15 )
+