summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorGabriel Russell <gabriel.russell@mongodb.com>2016-04-01 17:36:07 -0400
committerRamon Fernandez <ramon@mongodb.com>2016-04-21 15:09:59 -0400
commit7ed897882703723cc053faac6c3f634184caaa9f (patch)
tree9c21404a8373a48767562c046eefe66031fa79ab /src/mongo/shell
parent5089357158122b3c8b2c146210ac15fe9451c21c (diff)
downloadmongo-7ed897882703723cc053faac6c3f634184caaa9f.tar.gz
SERVER-23474 runMongoTool with --dialTimeout=30
(cherry picked from commit 08114e308f2f22ad95dbdc40e237578d57d4e957)
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/servers.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js
index 0a3aa462549..a8eb8753c34 100644
--- a/src/mongo/shell/servers.js
+++ b/src/mongo/shell/servers.js
@@ -793,6 +793,15 @@ var MongoRunner, _startMongod, startMongoProgram, runMongoProgram, startMongoPro
// Normalize and get the binary version to use
opts.binVersion = MongoRunner.getBinVersionFor(opts.binVersion);
+ // Recent versions of the mongo tools support a --dialTimeout flag to set for how
+ // long they retry connecting to a mongod or mongos process. We have them retry
+ // connecting for up to 30 seconds to handle when the tests are run on a
+ // resource-constrained host machine.
+ if (!opts.hasOwnProperty('dialTimeout') &&
+ MongoRunner.getBinVersionFor(opts.binVersion) === '') {
+ opts['dialTimeout'] = '30';
+ }
+
var argsArray = MongoRunner.arrOptions(binaryName, opts);
return runMongoProgram.apply(null, argsArray);