summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorVesselina Ratcheva <vesselina.ratcheva@10gen.com>2021-06-14 19:56:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-25 22:37:44 +0000
commit1dd2f1ae01d85c27c1ff1b5bfcbe69285bb84010 (patch)
treedbc9d06fa0035b205c2b973e745e866ba3d0ab24 /src/mongo/shell
parent49db4064d02edf55ae97114f6a55157596ae91ec (diff)
downloadmongo-1dd2f1ae01d85c27c1ff1b5bfcbe69285bb84010.tar.gz
SERVER-56446 Do not reauthenticate in ReplSetTest.restart() if 'waitForConnect=false' is specified
(cherry picked from commit db5ca00459eb05bea982cbf858d2cbdfb1ef221b)
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/replsettest.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index be8c6231f96..16f194470a8 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -2981,7 +2981,10 @@ var ReplSetTest = function(opts) {
var started = this.start(n, options, true, wait);
- if (jsTestOptions().keyFile) {
+ // We should not attempt to reauthenticate the connection if we did not wait for it
+ // to be reestablished in the first place.
+ const skipWaitForConnection = (options && options.waitForConnect === false);
+ if (jsTestOptions().keyFile && !skipWaitForConnection) {
if (started.length) {
// if n was an array of conns, start will return an array of connections
for (var i = 0; i < started.length; i++) {