diff options
author | gregs <greg@10gen.com> | 2011-10-07 12:44:36 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-02-03 19:06:56 -0500 |
commit | 9ee926acf4519ada709a0729c9780da98d0748f6 (patch) | |
tree | 91969eb55d8f47a0b4c6a332ff4227f3e594aeed | |
parent | 2d4f7f4c88b0bce3e96f1098b6d2eecce448388e (diff) | |
download | mongo-9ee926acf4519ada709a0729c9780da98d0748f6.tar.gz |
buildbot primary can change after reconfig replReads.js
-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() } |