summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2015-01-20 18:09:14 -0500
committerRandolph Tan <randolph@10gen.com>2015-01-21 11:29:28 -0500
commitcae09dfed0b4f785e3eacc0123ce3136b3484ef0 (patch)
tree65d8aa8ae302ea68624e9324884b0429f5518eb6
parentf346c4ad0c2d892014c79d7adbbca61031f50194 (diff)
downloadmongo-cae09dfed0b4f785e3eacc0123ce3136b3484ef0.tar.gz
SERVER-16961 incrementally cleanup connections in mongos_rs_shard_failure_tolerance.js
-rw-r--r--jstests/sharding/mongos_rs_shard_failure_tolerance.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/sharding/mongos_rs_shard_failure_tolerance.js b/jstests/sharding/mongos_rs_shard_failure_tolerance.js
index 63fdbacb11a..562f5873d27 100644
--- a/jstests/sharding/mongos_rs_shard_failure_tolerance.js
+++ b/jstests/sharding/mongos_rs_shard_failure_tolerance.js
@@ -229,6 +229,8 @@ mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setSlaveOk();
assert.neq(null, mongosConnNew.getCollection( collUnsharded.toString() ).findOne({ _id : 1 }) );
+gc(); // Clean up new connections incrementally to compensate for slow win32 machine.
+
mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("primary");
assert.neq(null, mongosConnNew.getCollection( collSharded.toString() ).findOne({ _id : -1 }));
@@ -241,6 +243,8 @@ mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("primary");
assert.neq(null, mongosConnNew.getCollection( collUnsharded.toString() ).findOne({ _id : 1 }));
+gc(); // Clean up new connections incrementally to compensate for slow win32 machine.
+
// Ensure read prefs override slaveok
mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setSlaveOk();
@@ -257,6 +261,8 @@ mongosConnNew.setSlaveOk();
mongosConnNew.setReadPref("primary");
assert.neq(null, mongosConnNew.getCollection( collUnsharded.toString() ).findOne({ _id : 1 }));
+gc(); // Clean up new connections incrementally to compensate for slow win32 machine.
+
mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("secondary");
assert.neq(null, mongosConnNew.getCollection( collSharded.toString() ).findOne({ _id : -1 }));
@@ -267,6 +273,8 @@ mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("secondary");
assert.neq(null, mongosConnNew.getCollection( collUnsharded.toString() ).findOne({ _id : 1 }));
+gc(); // Clean up new connections incrementally to compensate for slow win32 machine.
+
mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("primaryPreferred");
assert.neq(null, mongosConnNew.getCollection( collSharded.toString() ).findOne({ _id : -1 }));
@@ -277,6 +285,8 @@ mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("primaryPreferred");
assert.neq(null, mongosConnNew.getCollection( collUnsharded.toString() ).findOne({ _id : 1 }));
+gc(); // Clean up new connections incrementally to compensate for slow win32 machine.
+
mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("secondaryPreferred");
assert.neq(null, mongosConnNew.getCollection( collSharded.toString() ).findOne({ _id : -1 }));
@@ -287,6 +297,8 @@ mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("secondaryPreferred");
assert.neq(null, mongosConnNew.getCollection( collUnsharded.toString() ).findOne({ _id : 1 }));
+gc(); // Clean up new connections incrementally to compensate for slow win32 machine.
+
mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("nearest");
assert.neq(null, mongosConnNew.getCollection( collSharded.toString() ).findOne({ _id : -1 }));
@@ -297,6 +309,8 @@ mongosConnNew = new Mongo( mongos.host );
mongosConnNew.setReadPref("nearest");
assert.neq(null, mongosConnNew.getCollection( collUnsharded.toString() ).findOne({ _id : 1 }));
+gc(); // Clean up new connections incrementally to compensate for slow win32 machine.
+
// Writes
mongosConnNew = new Mongo( mongos.host );
assert.writeOK(mongosConnNew.getCollection( collSharded.toString() ).insert({ _id : -7 }, wc));