summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorKevin Pulo <kevin.pulo@mongodb.com>2017-09-18 15:27:07 +1000
committerKevin Pulo <kevin.pulo@mongodb.com>2017-10-04 11:47:12 +1100
commita18d0f0c5754c750b44ba05ad7cc26b1f8054625 (patch)
tree5302f3f19a29b7e42f6ac0a04b9039fdd132e9d9 /jstests
parentbd162a54bae444d280b9624bed2e0dd067f4bc0e (diff)
downloadmongo-a18d0f0c5754c750b44ba05ad7cc26b1f8054625.tar.gz
SERVER-19076 handle multiline shard keys in sh.status()
(cherry picked from commit 18645e165e5f23e899b32cb5ebe45e9750dd3a97) Switch back to calling sh.isBalancerRunning() from printShardingStatus(), because it has the correct behaviour for this version.
Diffstat (limited to 'jstests')
-rw-r--r--jstests/sharding/printShardingStatus.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/jstests/sharding/printShardingStatus.js b/jstests/sharding/printShardingStatus.js
index 85330311fd4..cdc36999e51 100644
--- a/jstests/sharding/printShardingStatus.js
+++ b/jstests/sharding/printShardingStatus.js
@@ -7,6 +7,8 @@
var st = new ShardingTest({shards: 1, mongos: 2, config: 1, other: {smallfiles: true}});
+ var standalone = MongoRunner.runMongod();
+
var mongos = st.s0;
var admin = mongos.getDB("admin");
@@ -85,9 +87,10 @@
testBasicVerboseOnly(outputVerbose);
// Take a copy of the config db, in order to test the harder-to-setup cases below.
+ // Copy into a standalone to also test running printShardingStatus() against a config dump.
// TODO: Replace this manual copy with copydb once SERVER-13080 is fixed.
var config = mongos.getDB("config");
- var configCopy = mongos.getDB("configCopy");
+ var configCopy = standalone.getDB("configCopy");
config.getCollectionInfos().forEach(function(c) {
// Create collection with options.
assert.commandWorked(configCopy.createCollection(c.name, c.options));
@@ -140,11 +143,11 @@
configCopy.mongos.remove({});
var output = grabStatusOutput(configCopy, false);
- assertPresentInOutput(output, "most recently active mongoses:\n\tnone", "no mongoses");
+ assertPresentInOutput(output, "most recently active mongoses:\n none", "no mongoses");
var output = grabStatusOutput(configCopy, true);
assertPresentInOutput(
- output, "most recently active mongoses:\n\tnone", "no mongoses (verbose)");
+ output, "most recently active mongoses:\n none", "no mongoses (verbose)");
assert(mongos.getDB(dbName).dropDatabase());
@@ -237,5 +240,7 @@
assert(mongos.getDB("test").dropDatabase());
+ MongoRunner.stopMongod(standalone);
+
st.stop();
})();