summaryrefslogtreecommitdiff
path: root/src/mongo/shell/shardingtest.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/shell/shardingtest.js')
-rw-r--r--src/mongo/shell/shardingtest.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js
index 39a41fb2d6e..e222bacc090 100644
--- a/src/mongo/shell/shardingtest.js
+++ b/src/mongo/shell/shardingtest.js
@@ -1490,6 +1490,7 @@ var ShardingTest = function(params) {
}
var rs = this._rs[i].test;
+ rs.awaitNodesAgreeOnPrimary();
rs.getPrimary().getDB("admin").foo.save({x: 1});
if (this.keyFile) {
@@ -1512,6 +1513,7 @@ var ShardingTest = function(params) {
this.configRS.initiateWithAnyNodeAsPrimary(config);
// Wait for master to be elected before starting mongos
+ this.configRS.awaitNodesAgreeOnPrimary();
var csrsPrimary = this.configRS.getPrimary();
print("ShardingTest startup and initiation for all nodes took " + (new Date() - startTime) +