summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-09-08 10:36:10 -0400
committerEliot Horowitz <eliot@10gen.com>2010-09-15 17:18:47 -0400
commit53c38f0c8ccadae8c8612baf792f4ebea3b435f8 (patch)
treed4f433e243b4de0f268979906784b40cdca316f5
parentf6c66f106cfb8fee5907d0aa7f0316be2966de52 (diff)
downloadmongo-53c38f0c8ccadae8c8612baf792f4ebea3b435f8.tar.gz
test for SERVER-1755
-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 00000000000..c451e7431a8
--- /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 )
+