Skip to content

Commit f9e7684

Browse files
fix non-determinisic FLE test
1 parent 460626a commit f9e7684

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/encryption/encryption.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,13 @@ describe('encryption integration tests', () => {
13171317

13181318
const collections = await connection.db.listCollections({}, { readPreference: 'primary' }).map(({ name }) => name).toArray();
13191319

1320+
collections.sort((a, b) => {
1321+
// depending on what letter name starts with, `name` might come before the two queryable encryption collections or after them.
1322+
// this method always puts the `name` collection first, and the two QE collections after it.
1323+
if (!a.includes('enxcol_')) return -1;
1324+
1325+
return a.localeCompare(b);
1326+
});
13201327
assert.deepEqual(collections, [
13211328
name,
13221329
`enxcol_.${name}.ecoc`,

0 commit comments

Comments
 (0)