diff options
author | gregs <greg@10gen.com> | 2011-10-07 12:44:36 -0400 |
---|---|---|
committer | gregs <greg@10gen.com> | 2011-10-07 12:44:55 -0400 |
commit | e35994823ac59fbb3e65ee236add1e45f227db87 (patch) | |
tree | 386b184482a513c6dbfd64d000488111b2fcabba /jstests/slowNightly | |
parent | bcf1fab6d70979a24163348f30219bd71e539bda (diff) | |
download | mongo-e35994823ac59fbb3e65ee236add1e45f227db87.tar.gz |
buildbot primary can change after reconfig replReads.js
Diffstat (limited to 'jstests/slowNightly')
-rw-r--r-- | jstests/slowNightly/replReads.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/jstests/slowNightly/replReads.js b/jstests/slowNightly/replReads.js index 4fe91305738..3744738c4a4 100644 --- a/jstests/slowNightly/replReads.js +++ b/jstests/slowNightly/replReads.js @@ -43,6 +43,8 @@ function testReadLoadBalancing(numReplicas) { assert.soon( function(){ return secondaries[i].getDB("test").foo.count() > 0; } ) secondaries[i].getDB('test').setProfilingLevel(2) } + // Primary may change with reconfig + primary.getDB('test').setProfilingLevel(2) for (var i = 0; i < secondaries.length * 10; i++) { conn = new Mongo(s._mongos[0].host) @@ -81,7 +83,10 @@ function testReadLoadBalancing(numReplicas) { return false; } , "one slave not ok" , 180000 , 5000 ); - + + // Secondaries may change here + secondaries = s._rs[0].test.liveNodes.slaves + for (var i = 0; i < secondaries.length * 10; i++) { conn = new Mongo(s._mongos[0].host) conn.setSlaveOk() @@ -95,7 +100,7 @@ function testReadLoadBalancing(numReplicas) { } counts = counts.sort(); - assert.eq( 20 , counts[1] - counts[0] , "counts wrong: " + tojson( counts ) ); + assert.eq( 20 , Math.abs( counts[1] - counts[0] ), "counts wrong: " + tojson( counts ) ); s.stop() } |