summaryrefslogtreecommitdiff
path: root/src/mongo/shell/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/shell/utils.js')
-rw-r--r--src/mongo/shell/utils.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js
index 3760ccd39a0..9794a60df4e 100644
--- a/src/mongo/shell/utils.js
+++ b/src/mongo/shell/utils.js
@@ -284,7 +284,15 @@ jsTest.authenticateNodes = function(nodes) {
assert.soonNoExcept(function() {
for (var i = 0; i < nodes.length; i++) {
// Don't try to authenticate to arbiters
- res = nodes[i].getDB("admin").runCommand({replSetGetStatus: 1});
+ try {
+ res = nodes[i].getDB("admin").runCommand({replSetGetStatus: 1});
+ } catch (e) {
+ // ReplicaSet tests which don't use auth are allowed to have nodes crash during
+ // startup. To allow tests which use to behavior to work with auth,
+ // attempting authentication against a dead node should be non-fatal.
+ print("Caught exception getting replSetStatus while authenticating: " + e);
+ continue;
+ }
if (res.myState == 7) {
continue;
}