diff options
author | Didier Nadeau <didier.nadeau@mongodb.com> | 2022-03-30 12:44:27 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-03-30 13:40:20 +0000 |
commit | 93243e0c29ba1f3eae4dc0251e775dc4f6a90c6c (patch) | |
tree | c9bc1b31c59be6e92b8ca1232faf4c189f3cf7e7 | |
parent | 3b106406facd601fff4f4607db74af626adab4ad (diff) | |
download | mongo-93243e0c29ba1f3eae4dc0251e775dc4f6a90c6c.tar.gz |
SERVER-65051 Ensures shard_split_basic_test commits a shard split
-rw-r--r-- | jstests/serverless/shard_split_basic_test.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/jstests/serverless/shard_split_basic_test.js b/jstests/serverless/shard_split_basic_test.js index 7cbfa492877..ad22026c10e 100644 --- a/jstests/serverless/shard_split_basic_test.js +++ b/jstests/serverless/shard_split_basic_test.js @@ -13,15 +13,8 @@ load("jstests/serverless/libs/basic_serverless_test.js"); const recipientTagName = "recipientNode"; const recipientSetName = "recipientSetName"; -const test = new BasicServerlessTest({ - recipientTagName, - recipientSetName, - quickGarbageCollection: true, - nodeOptions: { - setParameter: // Timeout to test that the operation times out waiting for replication - {shardSplitTimeoutMS: 2000} - } -}); +const test = + new BasicServerlessTest({recipientTagName, recipientSetName, quickGarbageCollection: true}); test.addRecipientNodes(); test.donor.awaitSecondaryNodes(); @@ -31,11 +24,18 @@ const migrationId = UUID(); jsTestLog("Running the commitShardSplit operation"); const admin = test.donor.getPrimary().getDB("admin"); const tenantIds = ["tenant1", "tenant2"]; -assert.commandWorked(admin.runCommand( - {commitShardSplit: 1, migrationId, tenantIds, recipientTagName, recipientSetName})); +assert.soon(() => { + const result = admin.runCommand( + {commitShardSplit: 1, migrationId, tenantIds, recipientTagName, recipientSetName}); + assert.commandWorked(result); + return result.state === 'committed'; +}); test.removeRecipientNodesFromDonor(); +// getPrimary can only be called once recipient nodes have been remove from test. +assertMigrationState(test.donor.getPrimary(), migrationId, "committed"); + test.forgetShardSplit(migrationId); test.waitForGarbageCollection(migrationId, tenantIds); |