summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorSpencer Jackson <spencer.jackson@mongodb.com>2021-07-14 20:55:53 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-16 14:42:28 +0000
commitbaf10e43643c83ba736c2f2a3d5c254d72026131 (patch)
treed81c4124ef49a4b6e47ec8b2def4dac256da3b4a /jstests
parent134914d052b0b925a27522c299e97293d6605a13 (diff)
downloadmongo-baf10e43643c83ba736c2f2a3d5c254d72026131.tar.gz
SERVER-58031 Shorten timeouts in ssl_cluster_ca.js
Diffstat (limited to 'jstests')
-rw-r--r--jstests/ssl/ssl_cluster_ca.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/ssl/ssl_cluster_ca.js b/jstests/ssl/ssl_cluster_ca.js
index babe3821bef..75419fb36d2 100644
--- a/jstests/ssl/ssl_cluster_ca.js
+++ b/jstests/ssl/ssl_cluster_ca.js
@@ -17,6 +17,13 @@ function testRS(opts, succeed) {
rs.initiate();
assert.commandWorked(rs.getPrimary().getDB('admin').runCommand({hello: 1}));
} else {
+ // By default, rs.initiate takes a very long time to timeout. We should shorten this
+ // period, because we expect it to fail. ReplSetTest has both a static and local copy
+ // of kDefaultTimeOutMS, so we must override both.
+ const oldTimeout = ReplSetTest.kDefaultTimeoutMS;
+ const shortTimeout = 2 * 60 * 1000;
+ ReplSetTest.kDefaultTimeoutMS = shortTimeout;
+ rs.kDefaultTimeoutMS = shortTimeout;
// The rs.initiate will fail in an assert.soon, which would ordinarily trigger the hang
// analyzer. We don't want that to happen, so we disable it here.
MongoRunner.runHangAnalyzer.disable();
@@ -25,6 +32,7 @@ function testRS(opts, succeed) {
rs.initiate();
});
} finally {
+ ReplSetTest.kDefaultTimeoutMS = oldTimeout;
MongoRunner.runHangAnalyzer.enable();
}
TestData.skipCheckDBHashes = true;