diff options
author | Justin Seyster <justin.seyster@mongodb.com> | 2018-09-10 17:57:31 -0400 |
---|---|---|
committer | Justin Seyster <justin.seyster@mongodb.com> | 2018-09-11 15:23:12 -0400 |
commit | 0f1ddc60647a7eacefde5c80ff73a4d41f8c7b11 (patch) | |
tree | 804e9d1ed86cb81209345a6f4ccc595d22e32daf /src/mongo | |
parent | 5c51b06d28670d598a03ae151ce455f3fb228b7b (diff) | |
download | mongo-0f1ddc60647a7eacefde5c80ff73a4d41f8c7b11.tar.gz |
SERVER-36435 Make ReplSetTest.kDefaultTimeoutMS accessible everywhere.
Tests should, generally, not be accessing global const values like
kReplDefaultTimeoutMS. This change removes that const and fixes the
detect_spawning_own_mongod.js override so that it no longer overwrites
ReplSetTest.kDefaultTimeoutMS, making it accessible to jstests that do
not operate on replica sets.
(cherry picked from commit eebc418c225b949e60927551451a8277115e8da6)
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/shell/replsettest.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js index 3a43b9c41f0..242725b57b9 100644 --- a/src/mongo/shell/replsettest.js +++ b/src/mongo/shell/replsettest.js @@ -68,9 +68,6 @@ * nodes {Array.<Mongo>} - connection to replica set members */ -/* Global default timeout variable */ -const kReplDefaultTimeoutMS = 10 * 60 * 1000; - var ReplSetTest = function(opts) { 'use strict'; @@ -95,7 +92,9 @@ var ReplSetTest = function(opts) { var _causalConsistency; - this.kDefaultTimeoutMS = kReplDefaultTimeoutMS; + // Some code still references kDefaultTimeoutMS as a (non-static) member variable, so make sure + // it's still accessible that way. + this.kDefaultTimeoutMS = ReplSetTest.kDefaultTimeoutMS; var oplogName = 'oplog.rs'; // Publicly exposed variables @@ -2566,10 +2565,9 @@ var ReplSetTest = function(opts) { }; /** - * Declare kDefaultTimeoutMS as a static property so we don't have to initialize - * a ReplSetTest object to use it. + * Global default timeout (10 minutes). */ -ReplSetTest.kDefaultTimeoutMS = kReplDefaultTimeoutMS; +ReplSetTest.kDefaultTimeoutMS = 10 * 60 * 1000; /** * Set of states that the replica set can be in. Used for the wait functions. |