summaryrefslogtreecommitdiff
path: root/jstests/replsets/replset1.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-08-03 00:07:34 -0400
committerEliot Horowitz <eliot@10gen.com>2010-08-03 00:07:34 -0400
commit41e7ed783c3cc5b6e46483a3024e2278a76a537a (patch)
tree8ae4c9cea9ab28eb9cfa97b06edc498d7adf86b3 /jstests/replsets/replset1.js
parentfd600969e0eccdfce48bb93fadaecc5daed64129 (diff)
downloadmongo-41e7ed783c3cc5b6e46483a3024e2278a76a537a.tar.gz
fix replset1
Diffstat (limited to 'jstests/replsets/replset1.js')
-rw-r--r--jstests/replsets/replset1.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/jstests/replsets/replset1.js b/jstests/replsets/replset1.js
index 61f3d99d549..6a18dffaaa2 100644
--- a/jstests/replsets/replset1.js
+++ b/jstests/replsets/replset1.js
@@ -70,9 +70,6 @@ doTest = function( signal ) {
}
- // Here's how to restart a node:
- replTest.restart( master_id );
-
// Now let's write some documents to the new master
for(var i=0; i<1000; i++) {
new_master.getDB("bar").bar.save({a: i});
@@ -82,6 +79,7 @@ doTest = function( signal ) {
// Here's how to restart the old master node:
slave = replTest.restart( master_id );
+
// Now, let's make sure that the old master comes up as a slave
assert.soon(function() {
var res = slave.getDB("admin").runCommand({ismaster: 1});
@@ -98,6 +96,7 @@ doTest = function( signal ) {
// And that both slave nodes have all the updates
new_master = replTest.getMaster();
+ assert.eq( 1000 , new_master.getDB( "bar" ).runCommand( { count:"bar"} ).n , "assumption 2")
replTest.awaitReplication();
slaves = replTest.liveNodes.slaves;
@@ -106,11 +105,11 @@ doTest = function( signal ) {
slave.setSlaveOk();
var count = slave.getDB("bar").runCommand({count: "bar"});
printjson( count );
- assert( count.n == 1000 , slave + " expected 1000 but count was " + count.n);
+ assert.eq( 1000 , count.n , "slave count wrong: " + slave );
});
// Shut down the set and finish the test.
replTest.stopSet( signal );
}
-// doTest( 15 );
+doTest( 15 );