diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2022-04-13 08:55:27 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-13 13:45:33 +0000 |
commit | 30a80b80911965bb9b60d3f8e912fc28524fb5bd (patch) | |
tree | 36f7dcc4eea25ccc9d82423924e571ad7d655b7b | |
parent | 6436db3ee23e051ef58456468f9d59199d6c6b40 (diff) | |
download | mongo-30a80b80911965bb9b60d3f8e912fc28524fb5bd.tar.gz |
SERVER-65170 Fix compact_structured_encryption_data_coordinator.js
-rw-r--r-- | jstests/fle2/libs/encrypted_client_util.js | 3 | ||||
-rw-r--r-- | jstests/sharding/compact_structured_encryption_data_coordinator.js | 26 |
2 files changed, 15 insertions, 14 deletions
diff --git a/jstests/fle2/libs/encrypted_client_util.js b/jstests/fle2/libs/encrypted_client_util.js index dcdb90cf4ec..64581c187e0 100644 --- a/jstests/fle2/libs/encrypted_client_util.js +++ b/jstests/fle2/libs/encrypted_client_util.js @@ -240,7 +240,8 @@ class EncryptedClient { const checkMap = {}; - // Always expect ESC and ECC collections, sometimes expect ECOC as well. + // Always expect ESC and ECC collections, optionally expect ECOC. + // ECOC is not expected in sharded clusters. checkMap[baseCollInfo.options.encryptedFields.escCollection] = true; checkMap[baseCollInfo.options.encryptedFields.eccCollection] = true; checkMap[baseCollInfo.options.encryptedFields.ecocCollection] = ecocExists; diff --git a/jstests/sharding/compact_structured_encryption_data_coordinator.js b/jstests/sharding/compact_structured_encryption_data_coordinator.js index ce60314e272..ed42d44b805 100644 --- a/jstests/sharding/compact_structured_encryption_data_coordinator.js +++ b/jstests/sharding/compact_structured_encryption_data_coordinator.js @@ -41,24 +41,24 @@ assert.commandWorked( client.createEncryptionCollection("encrypted", {encryptedFields: encryptedFields})); assert.commandWorked(test.createCollection("unencrypted")); -assert.commandFailedWithCode(test.unencrypted.compact(), ErrorCodes.BadValue); +assert.commandFailedWithCode(test.unencrypted.compact(), 6346807); const reply = assert.commandWorked(test.encrypted.compact()); jsTest.log(reply); // Validate dummy data we expect the placeholder compaction algorithm to return. -assert.eq(reply.stats.ecoc.read, 1); -assert.eq(reply.stats.ecoc.deleted, 2); - -assert.eq(reply.stats.ecc.read, 3); -assert.eq(reply.stats.ecc.inserted, 4); -assert.eq(reply.stats.ecc.updated, 5); -assert.eq(reply.stats.ecc.deleted, 6); - -assert.eq(reply.stats.esc.read, 7); -assert.eq(reply.stats.esc.inserted, 8); -assert.eq(reply.stats.esc.updated, 9); -assert.eq(reply.stats.esc.deleted, 10); +assert.eq(reply.stats.ecoc.read, 0); +assert.eq(reply.stats.ecoc.deleted, 0); + +assert.eq(reply.stats.ecc.read, 0); +assert.eq(reply.stats.ecc.inserted, 0); +assert.eq(reply.stats.ecc.updated, 0); +assert.eq(reply.stats.ecc.deleted, 0); + +assert.eq(reply.stats.esc.read, 0); +assert.eq(reply.stats.esc.inserted, 0); +assert.eq(reply.stats.esc.updated, 0); +assert.eq(reply.stats.esc.deleted, 0); // The eccoc collection is gone, so we should return quickly with no work done. const nowork = assert.commandWorked(test.encrypted.compact()); |