summaryrefslogtreecommitdiff
path: root/jstests/multiVersion/genericSetFCVUsage
diff options
context:
space:
mode:
authorMatt Broadstone <mbroadst@mongodb.com>2023-01-10 18:55:54 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-10 19:49:44 +0000
commitf846df62b5cc55de0fc0eda7051fcbeef029994f (patch)
tree49cf0e83b33f58e7a0bea03b54b0805d1dd7272a /jstests/multiVersion/genericSetFCVUsage
parent5139c8c1e3791516d6cd138e1ba7680ec59029aa (diff)
downloadmongo-f846df62b5cc55de0fc0eda7051fcbeef029994f.tar.gz
SERVER-72577 Convert tenant migrations tests to use es modules
Diffstat (limited to 'jstests/multiVersion/genericSetFCVUsage')
-rw-r--r--jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_abort_on_fcv_change.js7
-rw-r--r--jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch.js13
-rw-r--r--jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch_after_failover.js13
-rw-r--r--jstests/multiVersion/genericSetFCVUsage/tenant_migration_recipient_abort_on_fcv_change.js7
-rw-r--r--jstests/multiVersion/genericSetFCVUsage/tenant_migration_save_fcv.js29
5 files changed, 25 insertions, 44 deletions
diff --git a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_abort_on_fcv_change.js b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_abort_on_fcv_change.js
index c749ba29b5c..73326dd39ef 100644
--- a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_abort_on_fcv_change.js
+++ b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_abort_on_fcv_change.js
@@ -7,15 +7,11 @@
* ]
*/
-(function() {
-"use strict";
-
+import {TenantMigrationTest} from "jstests/replsets/libs/tenant_migration_test.js";
load("jstests/libs/fail_point_util.js");
load("jstests/libs/uuid_util.js"); // for 'extractUUIDFromObject'
load("jstests/libs/parallelTester.js"); // for 'Thread'
load("jstests/replsets/rslib.js"); // for 'setLogVerbosity'
-load("jstests/replsets/libs/tenant_migration_test.js");
-load("jstests/replsets/libs/tenant_migration_util.js");
const tenantMigrationTest = new TenantMigrationTest({name: jsTestName()});
@@ -65,4 +61,3 @@ tenantMigrationTest.waitForDonorNodesToReachState(
assert.commandWorked(tenantMigrationTest.forgetMigration(migrationOpts.migrationIdString));
tenantMigrationTest.stop();
-})();
diff --git a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch.js b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch.js
index 35ed7fd811e..8c924efe732 100644
--- a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch.js
+++ b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch.js
@@ -7,16 +7,12 @@
* ]
*/
-(function() {
-"use strict";
+import {TenantMigrationTest} from "jstests/replsets/libs/tenant_migration_test.js";
+load("jstests/libs/fail_point_util.js");
+load("jstests/libs/uuid_util.js"); // for 'extractUUIDFromObject'
+load("jstests/libs/parallelTester.js"); // for 'Thread'
function runTest(downgradeFCV) {
- load("jstests/libs/fail_point_util.js");
- load("jstests/libs/uuid_util.js"); // for 'extractUUIDFromObject'
- load("jstests/libs/parallelTester.js"); // for 'Thread'
- load("jstests/replsets/libs/tenant_migration_test.js");
- load("jstests/replsets/libs/tenant_migration_util.js");
-
const tenantMigrationTest = new TenantMigrationTest({name: jsTestName()});
const tenantId = ObjectId().str;
@@ -64,4 +60,3 @@ runTest(lastContinuousFCV);
if (lastContinuousFCV != lastLTSFCV) {
runTest(lastLTSFCV);
}
-})();
diff --git a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch_after_failover.js b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch_after_failover.js
index 661b2b6e62d..4e40d7e5c3f 100644
--- a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch_after_failover.js
+++ b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_donor_recipient_fcv_mismatch_after_failover.js
@@ -8,16 +8,12 @@
* ]
*/
-(function() {
-"use strict";
+import {TenantMigrationTest} from "jstests/replsets/libs/tenant_migration_test.js";
+load("jstests/libs/fail_point_util.js");
+load("jstests/libs/uuid_util.js"); // for 'extractUUIDFromObject'
+load("jstests/libs/parallelTester.js"); // for 'Thread'
function runTest(downgradeFCV) {
- load("jstests/libs/fail_point_util.js");
- load("jstests/libs/uuid_util.js"); // for 'extractUUIDFromObject'
- load("jstests/libs/parallelTester.js"); // for 'Thread'
- load("jstests/replsets/libs/tenant_migration_test.js");
- load("jstests/replsets/libs/tenant_migration_util.js");
-
const tenantMigrationTest = new TenantMigrationTest({name: jsTestName()});
const tenantId = ObjectId().str;
@@ -73,4 +69,3 @@ runTest(lastContinuousFCV);
if (lastContinuousFCV != lastLTSFCV) {
runTest(lastLTSFCV);
}
-})();
diff --git a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_recipient_abort_on_fcv_change.js b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_recipient_abort_on_fcv_change.js
index 76110d70267..717cf2e5287 100644
--- a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_recipient_abort_on_fcv_change.js
+++ b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_recipient_abort_on_fcv_change.js
@@ -7,15 +7,11 @@
* ]
*/
-(function() {
-"use strict";
-
+import {TenantMigrationTest} from "jstests/replsets/libs/tenant_migration_test.js";
load("jstests/libs/fail_point_util.js");
load("jstests/libs/uuid_util.js"); // for 'extractUUIDFromObject'
load("jstests/libs/parallelTester.js"); // for 'Thread'
load("jstests/replsets/rslib.js"); // for 'setLogVerbosity'
-load("jstests/replsets/libs/tenant_migration_test.js");
-load("jstests/replsets/libs/tenant_migration_util.js");
const tenantMigrationTest = new TenantMigrationTest({name: jsTestName()});
@@ -74,4 +70,3 @@ tenantMigrationTest.waitForDonorNodesToReachState(
assert.commandWorked(tenantMigrationTest.forgetMigration(migrationOpts.migrationIdString));
tenantMigrationTest.stop();
-})();
diff --git a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_save_fcv.js b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_save_fcv.js
index 9533f8c01d4..2a88f62439b 100644
--- a/jstests/multiVersion/genericSetFCVUsage/tenant_migration_save_fcv.js
+++ b/jstests/multiVersion/genericSetFCVUsage/tenant_migration_save_fcv.js
@@ -8,20 +8,23 @@
* ]
*/
-(function() {
-"use strict";
+import {TenantMigrationTest} from "jstests/replsets/libs/tenant_migration_test.js";
+import {
+ isShardMergeEnabled,
+ makeX509OptionsForTest,
+ runMigrationAsync
+} from "jstests/replsets/libs/tenant_migration_util.js";
+
+load("jstests/libs/fail_point_util.js");
+load("jstests/libs/uuid_util.js"); // for 'extractUUIDFromObject'
+load("jstests/libs/parallelTester.js"); // for 'Thread'
+load("jstests/replsets/rslib.js"); // 'createRstArgs'
function runTest(downgradeFCV) {
- load("jstests/libs/fail_point_util.js");
- load("jstests/libs/uuid_util.js"); // for 'extractUUIDFromObject'
- load("jstests/libs/parallelTester.js"); // for 'Thread'
- load("jstests/replsets/libs/tenant_migration_test.js");
- load("jstests/replsets/libs/tenant_migration_util.js");
-
const recipientRst = new ReplSetTest({
nodes: 2,
name: jsTestName() + "_recipient",
- nodeOptions: TenantMigrationUtil.makeX509OptionsForTest().recipient
+ nodeOptions: makeX509OptionsForTest().recipient
});
recipientRst.startSet();
@@ -50,13 +53,12 @@ function runTest(downgradeFCV) {
recipientDb, "fpAfterRecordingRecipientPrimaryStartingFCV", {action: "hang"});
// Start a migration and wait for recipient to hang at the failpoint.
- const donorRstArgs = TenantMigrationUtil.createRstArgs(tenantMigrationTest.getDonorRst());
- const migrationThread =
- new Thread(TenantMigrationUtil.runMigrationAsync, migrationOpts, donorRstArgs);
+ const donorRstArgs = createRstArgs(tenantMigrationTest.getDonorRst());
+ const migrationThread = new Thread(runMigrationAsync, migrationOpts, donorRstArgs);
migrationThread.start();
hangAfterSavingFCV.wait();
- const isRunningMergeProtocol = TenantMigrationUtil.isShardMergeEnabled(recipientDb);
+ const isRunningMergeProtocol = isShardMergeEnabled(recipientDb);
// Downgrade the FCV for the recipient set.
assert.commandWorked(
@@ -89,4 +91,3 @@ runTest(lastContinuousFCV);
if (lastContinuousFCV != lastLTSFCV) {
runTest(lastLTSFCV);
}
-})();