summaryrefslogtreecommitdiff
path: root/src/mongo/shell/servers.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/shell/servers.js')
-rw-r--r--src/mongo/shell/servers.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js
index 0d2f3adad7a..e9334c4b8d8 100644
--- a/src/mongo/shell/servers.js
+++ b/src/mongo/shell/servers.js
@@ -1114,12 +1114,20 @@ var MongoRunner, _startMongod, startMongoProgram, runMongoProgram, startMongoPro
if (programName.endsWith('mongos')) {
// apply setParameters for mongos
if (jsTest.options().setParametersMongos) {
- var params = jsTest.options().setParametersMongos.split(",");
- if (params && params.length > 0) {
- params.forEach(function(p) {
- if (p)
- argArray.push(...['--setParameter', p]);
- });
+ let params = jsTest.options().setParametersMongos;
+ for (let paramName of Object.keys(params)) {
+ // Only set the 'logComponentVerbosity' parameter if it has not already
+ // been specified in the given argument array. This means that any
+ // 'logComponentVerbosity' settings passed through via TestData will
+ // always be overridden by settings passed directly to MongoRunner from
+ // within the shell.
+ if (paramName === "logComponentVerbosity" &&
+ argArrayContains("logComponentVerbosity")) {
+ continue;
+ }
+ const paramVal = params[paramName];
+ const setParamStr = paramName + "=" + JSON.stringify(paramVal);
+ argArray.push(...['--setParameter', setParamStr]);
}
}
} else if (baseProgramName === 'mongod') {