diff options
-rw-r--r-- | jstests/core/index_bigkeys.js | 2 | ||||
-rw-r--r-- | jstests/core/index_bigkeys_background.js | 21 | ||||
-rw-r--r-- | jstests/libs/index_bigkeys.js | 14 |
3 files changed, 6 insertions, 31 deletions
diff --git a/jstests/core/index_bigkeys.js b/jstests/core/index_bigkeys.js index be8ae1f8d65..fa53a70a87d 100644 --- a/jstests/core/index_bigkeys.js +++ b/jstests/core/index_bigkeys.js @@ -13,5 +13,5 @@ load("jstests/libs/index_bigkeys.js"); const collName = "index_bigkeys_foreground_test"; -testAllInteractionsWithBigIndexKeys(db, collName, false); +testAllInteractionsWithBigIndexKeys(db, collName); }()); diff --git a/jstests/core/index_bigkeys_background.js b/jstests/core/index_bigkeys_background.js deleted file mode 100644 index d65d71f7442..00000000000 --- a/jstests/core/index_bigkeys_background.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Test interactions with big index keys. There should be no size limit for index keys. - * - * assumes_no_implicit_index_creation: Cannot implicitly shard accessed collections because of extra - * shard key index in sharded collection. - * requires_non_retryable_writes: This test uses delete which is not retryable. - * @tags: [ - * assumes_no_implicit_index_creation, - * requires_background_index, - * requires_non_retryable_writes - * ] - */ -(function() { -"use strict"; - -load("jstests/libs/index_bigkeys.js"); - -const collName = "index_bigkeys_background_test"; - -testAllInteractionsWithBigIndexKeys(db, collName, true); -}()); diff --git a/jstests/libs/index_bigkeys.js b/jstests/libs/index_bigkeys.js index 0bc891f7086..bb410f6debe 100644 --- a/jstests/libs/index_bigkeys.js +++ b/jstests/libs/index_bigkeys.js @@ -80,13 +80,9 @@ function deleteIndexKeysByUpdateDocs(testDB, collName, keys) { } } -function createIndex(testColl, background, unique) { +function createIndex(testColl, unique) { let numIndexesBefore = testColl.getIndexes().length; - if (background) - assert.commandWorked( - testColl.createIndex({k: 1}, {background: background, unique: unique})); - else - assert.commandWorked(testColl.createIndex({k: 1}, {unique: unique})); + assert.commandWorked(testColl.createIndex({k: 1}, {unique: unique})); assert.eq(numIndexesBefore + 1, testColl.getIndexes().length); } @@ -100,7 +96,7 @@ function dropIndex(testColl) { /** * This test makes sure we can insert, read, update and delete big index keys. */ -function testAllInteractionsWithBigIndexKeys(testDB, collName, backgroundIndexBuild) { +function testAllInteractionsWithBigIndexKeys(testDB, collName) { [true, false].forEach(function(uniqueIndex) { [true, false].forEach(function(createIndexFirst) { for (let i = 0; i < bigKeyGroups.length; i++) { @@ -112,11 +108,11 @@ function testAllInteractionsWithBigIndexKeys(testDB, collName, backgroundIndexBu // Test that we can insert big index keys. if (createIndexFirst) { - createIndex(testColl, backgroundIndexBuild, uniqueIndex); + createIndex(testColl, uniqueIndex); insertIndexKeysByInsertDocs(testColl, keys); } else { insertIndexKeysByInsertDocs(testColl, keys); - createIndex(testColl, backgroundIndexBuild, uniqueIndex); + createIndex(testColl, uniqueIndex); } // Test that we can read big index keys by querying with keys. |