summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2016-03-15 08:34:16 -0400
committerEric Milkie <milkie@10gen.com>2016-03-15 16:26:07 -0400
commitebf68ba0923844afefd6a9e237d478672da5e40d (patch)
tree28ee5bdf6dfb923b428b053d48d040efe18333e9
parent6210410de52b7695ffd2415ee2f1dea0374d24b2 (diff)
downloadmongo-ebf68ba0923844afefd6a9e237d478672da5e40d.tar.gz
SERVER-23148 patch multi_rs.js to ensure replSetMaintenance command succeeds
-rw-r--r--jstests/multiVersion/libs/multi_rs.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/jstests/multiVersion/libs/multi_rs.js b/jstests/multiVersion/libs/multi_rs.js
index 109db580453..1dca614ebe4 100644
--- a/jstests/multiVersion/libs/multi_rs.js
+++ b/jstests/multiVersion/libs/multi_rs.js
@@ -49,7 +49,12 @@ ReplSetTest.prototype.upgradeNode = function(node, opts, user, pwd) {
var isMaster = node.getDB('admin').runCommand({isMaster: 1});
if (!isMaster.arbiterOnly) {
- assert.commandWorked(node.adminCommand("replSetMaintenance"));
+ // Must retry this command, as it might return "currently running for election" and fail.
+ // Node might still be running for an election that will fail because it lost the election
+ // race with another node, at test initialization. See SERVER-23133.
+ assert.soon(function() {
+ return (node.adminCommand("replSetMaintenance").ok);
+ });
this.waitForState(node, ReplSetTest.State.RECOVERING);
}