Permalink
Browse files

added socket timeouts to connections.

  • Loading branch information...
1 parent 4e5eee1 commit 1d00ea157c03b2251ed0e72df3a6527cd36af850 @rgnitz rgnitz committed Jan 6, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/test/com/mongodb/SecondaryReadTest.java
@@ -203,7 +203,7 @@ private boolean serverIsSecondary(final ServerAddress pServerAddr, final List<Te
}
private Mongo loadMongo() throws Exception {
- return new Mongo(new MongoURI("mongodb://127.0.0.1:27017,127.0.0.1:27018"));
+ return new Mongo(new MongoURI("mongodb://127.0.0.1:27017,127.0.0.1:27018/?connectTimeoutMS=20000;socketTimeoutMS=20000;maxpoolsize=50;autoconnectretry=true"));
}
private CommandResult serverStatusCmd(final Mongo pMongo) {
@@ -308,7 +308,7 @@ private void verifySecondaryCounts(final int pSecondaryCount, final List<TestHos
private static void loadQueryCount(final List<TestHost> pHosts, final boolean pBefore) throws Exception {
for (final TestHost testHost : pHosts) {
- final Mongo mongoHost = new Mongo(new MongoURI("mongodb://"+testHost.hostnameAndPort));
+ final Mongo mongoHost = new Mongo(new MongoURI("mongodb://"+testHost.hostnameAndPort+"/?connectTimeoutMS=20000;socketTimeoutMS=20000;maxpoolsize=50;autoconnectretry=true"));
try {
final CommandResult serverStatusResult
= mongoHost.getDB("com_mongodb_unittest_SecondaryReadTest").command(new BasicDBObject("serverStatus", 1));

0 comments on commit 1d00ea1

Please sign in to comment.