Permalink
Browse files

buildbot primary can change after reconfig replReads.js

  • Loading branch information...
gregs authored and erh committed Oct 7, 2011
1 parent 2d4f7f4 commit 9ee926acf4519ada709a0729c9780da98d0748f6
Showing with 7 additions and 2 deletions.
  1. +7 −2 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()
}

0 comments on commit 9ee926a

Please sign in to comment.