summaryrefslogtreecommitdiff
path: root/jstests/sharding/shard6.js
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-02-12 17:05:24 -0500
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-02-12 17:05:24 -0500
commitd33ad75fcb7b842b61df53cff0d4907e77cc84db (patch)
treee347202468e6e81a700f60f3ceba9e10a5792c67 /jstests/sharding/shard6.js
parent543bf9945a662d6aba31df847cd9153c28b440eb (diff)
downloadmongo-d33ad75fcb7b842b61df53cff0d4907e77cc84db.tar.gz
SERVER-22494 shard6.js test needs to account for ReplicaSetMonitor
Diffstat (limited to 'jstests/sharding/shard6.js')
-rw-r--r--jstests/sharding/shard6.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/jstests/sharding/shard6.js b/jstests/sharding/shard6.js
index 843780a6fa0..abc0b5adb31 100644
--- a/jstests/sharding/shard6.js
+++ b/jstests/sharding/shard6.js
@@ -24,7 +24,7 @@ function poolStats( where ){
printjson( x );
print( "****\n" + msg + "\n*****" );
summary += msg + "\n";
- return total;
+ return [total, x.length];
}
poolStats( "at start" );
@@ -54,7 +54,16 @@ for ( var i=1; i<10; i++ ){
poolStats( "after loop : " + i );
}
-assert.eq( connBefore , poolStats( "limit test done" ) , "limit test conns" );
+// we do not want the number of connections from mongos to mongod to increase
+// but it may have because of the background replica set monitor, and that case is ok.
+// This is due to SERVER-22564.
+limitTestAfterConns = poolStats( "limit test done" );
+
+// only check the number of connections is the same if the number of hosts we are connected to
+// remains the same. TODO: remove host count check after SERVER-22564 is fixed.
+if( limitTestAfterConns[1] == connBefore[1]) {
+ assert.eq( connBefore[0] , limitTestAfterConns[0], "limit test conns" );
+}
function assertOrder( start , num ){
var a = db.data.find().skip(start).limit(num).sort( { num : 1 } ).map( function(z){ return z.num; } );
@@ -78,7 +87,6 @@ function doItCount( skip , sort , batchSize ){
if ( batchSize )
c.batchSize( batchSize );
return c.itcount();
-
}
function checkItCount( batchSize ){