diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-11-25 11:20:43 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-12-08 13:15:06 -0500 |
commit | c078dc37a90edcbe4d4c5a0cfe3f57ef624f6820 (patch) | |
tree | 5559fdddc2f0405aebf73ba5e1a5a95e2a7bd1fc /jstests/sharding/sharding_rs2.js | |
parent | d4396cda27baf96715f787fae10df97a77c9576f (diff) | |
download | mongo-c078dc37a90edcbe4d4c5a0cfe3f57ef624f6820.tar.gz |
SERVER-21050 Cleanup ReplSetTest
This is just a cleanup work to hide some of the private state of
ReplSetTest so it is easier to encapsulate and add new logic. Also enables
strict mode.
Diffstat (limited to 'jstests/sharding/sharding_rs2.js')
-rw-r--r-- | jstests/sharding/sharding_rs2.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/jstests/sharding/sharding_rs2.js b/jstests/sharding/sharding_rs2.js index 1dfa816c637..e3a2082ba8d 100644 --- a/jstests/sharding/sharding_rs2.js +++ b/jstests/sharding/sharding_rs2.js @@ -47,7 +47,7 @@ catch ( e ){ assert.soon( function(){ try { - printjson( rs.test.getMaster().getDB("admin").runCommand( "isMaster" ) ) + printjson( rs.test.getPrimary().getDB("admin").runCommand( "isMaster" ) ) s.config.shards.find().forEach( printjsononeline ); return countNodes() == 3; } @@ -80,7 +80,7 @@ rs.test.waitForState( rs.test.getSecondaries(), rs.test.SECONDARY, 180 * 1000 ) m = new Mongo( s.s.name ); ts = m.getDB( "test" ).foo -before = rs.test.getMaster().adminCommand( "serverStatus" ).opcounters +before = rs.test.getPrimary().adminCommand( "serverStatus" ).opcounters for ( i=0; i<10; i++ ) assert.eq( 17 , ts.findOne().x , "B1" ) @@ -89,7 +89,7 @@ m.setSlaveOk() for ( i=0; i<10; i++ ) assert.eq( 17 , ts.findOne().x , "B2" ) -after = rs.test.getMaster().adminCommand( "serverStatus" ).opcounters +after = rs.test.getPrimary().adminCommand( "serverStatus" ).opcounters printjson( before ) printjson( after ) @@ -141,14 +141,14 @@ assert.commandWorked(s.getDB('admin').runCommand({ moveChunk: "test.foo", _waitForDelete: true })); assert.eq( 100 , t.count() , "C3" ) -assert.eq( 50 , rs.test.getMaster().getDB( "test" ).foo.count() , "C4" ) +assert.eq( 50 , rs.test.getPrimary().getDB( "test" ).foo.count() , "C4" ) // by non-shard key m = new Mongo( s.s.name ); ts = m.getDB( "test" ).foo -before = rs.test.getMaster().adminCommand( "serverStatus" ).opcounters +before = rs.test.getPrimary().adminCommand( "serverStatus" ).opcounters for ( i=0; i<10; i++ ) assert.eq( 17 , ts.findOne( { _id : 5 } ).x , "D1" ) @@ -157,7 +157,7 @@ m.setSlaveOk() for ( i=0; i<10; i++ ) assert.eq( 17 , ts.findOne( { _id : 5 } ).x , "D2" ) -after = rs.test.getMaster().adminCommand( "serverStatus" ).opcounters +after = rs.test.getPrimary().adminCommand( "serverStatus" ).opcounters assert.lte( before.query + 10 , after.query , "D3" ) @@ -170,7 +170,7 @@ db.printShardingStatus() ts = m.getDB( "test" ).foo -before = rs.test.getMaster().adminCommand( "serverStatus" ).opcounters +before = rs.test.getPrimary().adminCommand( "serverStatus" ).opcounters for ( i=0; i<10; i++ ) assert.eq( 57 , ts.findOne( { x : 57 } ).x , "E1" ) @@ -179,7 +179,7 @@ m.setSlaveOk() for ( i=0; i<10; i++ ) assert.eq( 57 , ts.findOne( { x : 57 } ).x , "E2" ) -after = rs.test.getMaster().adminCommand( "serverStatus" ).opcounters +after = rs.test.getPrimary().adminCommand( "serverStatus" ).opcounters assert.lte( before.query + 10 , after.query , "E3" ) |