diff options
author | Kyle Banker <kylebanker@gmail.com> | 2010-07-26 15:08:04 -0400 |
---|---|---|
committer | Kyle Banker <kylebanker@gmail.com> | 2010-07-26 15:08:04 -0400 |
commit | e94cc361ed088b5cb1f2cfe8ab30fc641c74639e (patch) | |
tree | b28b1fd585eb56da95acb58dae464657d9683a7b /jstests/replsets/replset1.js | |
parent | 9d08a04e8e0faa13ac62c1cc1997822339fb6950 (diff) | |
download | mongo-e94cc361ed088b5cb1f2cfe8ab30fc641c74639e.tar.gz |
SERVER-1479 and replSet js test cleanup
Diffstat (limited to 'jstests/replsets/replset1.js')
-rw-r--r-- | jstests/replsets/replset1.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/jstests/replsets/replset1.js b/jstests/replsets/replset1.js index 28d58a3f6f2..3898b4cf5d7 100644 --- a/jstests/replsets/replset1.js +++ b/jstests/replsets/replset1.js @@ -1,6 +1,9 @@ - doTest = function( signal ) { + // Test basic replica set functionality. + // -- Replication + // -- Failover + // Replica set testing API // Create a new replica set test. Specify set name and the number of nodes you want. var replTest = new ReplSetTest( {name: 'testSet', nodes: 3} ); @@ -31,20 +34,10 @@ doTest = function( signal ) { // and slaves in the set and wait until the change has replicated. replTest.awaitReplication(); - print("Node Ids"); - print(replTest.getNodeId( master )) - print(replTest.getNodeId(replTest.liveNodes.slaves[0])); - print(replTest.getNodeId(replTest.liveNodes.slaves[1])); - // Here's how to stop the master node var master_id = replTest.getNodeId( master ); replTest.stop( master_id ); - sleep(10000); - - // Here's how to restart it - replTest.start( master_id, {}, true ); - // Now let's see who the new master is: var new_master = replTest.getMaster(); @@ -52,6 +45,13 @@ doTest = function( signal ) { var new_master_id = replTest.getNodeId( new_master ); assert( master_id != new_master_id, "Old master shouldn't be equal to new master." ); + + // Here's how to restart a node: + replTest.start( master_id, {}, true ); + + + // Shut down the set and finish the test. + replTest.stopSet( signal ); } -doTest( 9 ); +doTest( 15 ); |