summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2019-01-14 13:52:04 -0500
committerRandolph Tan <randolph@10gen.com>2019-06-03 11:41:05 -0400
commit795dc5cb3977fc67e0cd640aa98b82138ccc6380 (patch)
tree2973a9950e9a74ff776f3c0c3304d4ed689e9139
parentc3009e2df624ad215697f86e6873f7bff4302e5b (diff)
downloadmongo-795dc5cb3977fc67e0cd640aa98b82138ccc6380.tar.gz
SERVER-37382 printShardingStatus.js races with ShardingUptimeReporter thread
(cherry picked from commit ae932281fe1677400456ee5297764606cac6f577)
-rw-r--r--jstests/sharding/printShardingStatus.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/jstests/sharding/printShardingStatus.js b/jstests/sharding/printShardingStatus.js
index cdc36999e51..04233c03090 100644
--- a/jstests/sharding/printShardingStatus.js
+++ b/jstests/sharding/printShardingStatus.js
@@ -5,13 +5,22 @@
(function() {
'use strict';
- var st = new ShardingTest({shards: 1, mongos: 2, config: 1, other: {smallfiles: true}});
+ const MONGOS_COUNT = 2;
+
+ var st =
+ new ShardingTest({shards: 1, mongos: MONGOS_COUNT, config: 1, other: {smallfiles: true}});
var standalone = MongoRunner.runMongod();
var mongos = st.s0;
var admin = mongos.getDB("admin");
+ // Wait for the background thread from the mongos to insert their entries before beginning
+ // the tests.
+ assert.soon(function() {
+ return MONGOS_COUNT == mongos.getDB('config').mongos.count();
+ });
+
function grabStatusOutput(configdb, verbose) {
var res = print.captureAllOutput(function() {
return printShardingStatus(configdb, verbose);