diff options
author | Benety Goh <benety@mongodb.com> | 2021-06-11 10:33:47 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-11 15:42:17 +0000 |
commit | 7dbe1790e854157fae9e612e7a925f9083efbbfc (patch) | |
tree | eb17de61dd0d09e16a7ef033b3173f87e4137552 /jstests | |
parent | a93e160436297f2a853b59e40eeb8c186b1879cf (diff) | |
download | mongo-7dbe1790e854157fae9e612e7a925f9083efbbfc.tar.gz |
SERVER-57286 clean up merge_sort_collation.js to use different collection name for each test case
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/merge_sort_collation.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/jstests/core/merge_sort_collation.js b/jstests/core/merge_sort_collation.js index 5f25b4e0ae4..176d0d842c3 100644 --- a/jstests/core/merge_sort_collation.js +++ b/jstests/core/merge_sort_collation.js @@ -3,29 +3,32 @@ * 1) explode for sort query planner behavior related to the selection of MERGE_SORT stage; * 2) MERGE_SORT stage execution. * @tags: [ + * assumes_no_implicit_collection_creation_after_drop, * requires_find_command, * ] */ (function() { "use strict"; -const testDB = db.getSiblingDB(jsTestName()); -const coll = testDB.explode_for_sort; +const collNamePrefix = 'merge_sort_collation_'; +let collCount = 0; // Executes a test case that creates a collection and indexes, inserts documents, issues a find // query on a collection and compares the results with the expected collection. function executeQueryTestCase(testCase) { + let coll = db.getCollection(collNamePrefix + collCount++); + Object.assign(testCase, {ns: coll.getFullName()}); jsTestLog(tojson(testCase)); - // Drop the test database. - assert.commandWorked(testDB.dropDatabase()); + // Drop the test collection. + coll.drop(); // Create a collection. const collectionOptions = {}; if (testCase.collectionCollation !== undefined) { collectionOptions.collation = testCase.collectionCollation; } - assert.commandWorked(testDB.createCollection(coll.getName(), collectionOptions)); + assert.commandWorked(db.createCollection(coll.getName(), collectionOptions)); // Create index(es). if (testCase.indexes !== undefined) { |