diff options
Diffstat (limited to 'jstests/replsets/tenant_migration_donor_state_machine.js')
-rw-r--r-- | jstests/replsets/tenant_migration_donor_state_machine.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/jstests/replsets/tenant_migration_donor_state_machine.js b/jstests/replsets/tenant_migration_donor_state_machine.js index 062c404928a..47cd092703b 100644 --- a/jstests/replsets/tenant_migration_donor_state_machine.js +++ b/jstests/replsets/tenant_migration_donor_state_machine.js @@ -177,9 +177,8 @@ function testStats(node, { // Allow the migration to complete. blockingFp.off(); - const stateRes = - assert.commandWorked(tenantMigrationTest.waitForMigrationToComplete(migrationOpts)); - assert.eq(stateRes.state, TenantMigrationTest.DonorState.kCommitted); + TenantMigrationTest.assertCommitted( + tenantMigrationTest.waitForMigrationToComplete(migrationOpts)); donorDoc = configDonorsColl.findOne({tenantId: kTenantId}); let commitOplogEntry = donorPrimary.getDB("local").oplog.rs.findOne( @@ -219,9 +218,8 @@ function testStats(node, { configureFailPoint(recipientPrimary, "fpBeforeFulfillingDataConsistentPromise", {action: "stop", stopErrorCode: ErrorCodes.InternalError}); - const stateRes = assert.commandWorked(tenantMigrationTest.runMigration( + TenantMigrationTest.assertAborted(tenantMigrationTest.runMigration( migrationOpts, false /* retryOnRetryableErrors */, false /* automaticForgetMigration */)); - assert.eq(stateRes.state, TenantMigrationTest.DonorState.kAborted); abortRecipientFp.off(); const donorDoc = configDonorsColl.findOne({tenantId: kTenantId}); @@ -262,9 +260,8 @@ function testStats(node, { let abortDonorFp = configureFailPoint(donorPrimary, "abortTenantMigrationBeforeLeavingBlockingState"); - const stateRes = assert.commandWorked(tenantMigrationTest.runMigration( + TenantMigrationTest.assertAborted(tenantMigrationTest.runMigration( migrationOpts, false /* retryOnRetryableErrors */, false /* automaticForgetMigration */)); - assert.eq(stateRes.state, TenantMigrationTest.DonorState.kAborted); abortDonorFp.off(); const donorDoc = configDonorsColl.findOne({tenantId: kTenantId}); @@ -312,9 +309,8 @@ configDonorsColl.dropIndex({expireAt: 1}); donorPrimary.adminCommand({donorForgetMigration: 1, migrationId: migrationId}), ErrorCodes.NoSuchTenantMigration); - const stateRes = assert.commandWorked(tenantMigrationTest.runMigration( + TenantMigrationTest.assertCommitted(tenantMigrationTest.runMigration( migrationOpts, false /* retryOnRetryableErrors */, false /* automaticForgetMigration */)); - assert.eq(stateRes.state, TenantMigrationTest.DonorState.kCommitted); assert.commandWorked( donorPrimary.adminCommand({donorForgetMigration: 1, migrationId: migrationId})); |