summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorYuhong Zhang <danielzhangyh@gmail.com>2020-07-07 14:04:48 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-08 12:47:34 +0000
commitd4c7887dfae2d861cd4bb3118d576aee3c4f353f (patch)
treeca843c36c41187fe027e54e8a259bf798b40caba /jstests
parente072f83477821354e9cde09298da03e1ae9c442c (diff)
downloadmongo-d4c7887dfae2d861cd4bb3118d576aee3c4f353f.tar.gz
SERVER-40102 index_bigkeys.js and index_bigkeys_background.js do the same thing now that background doesn't exist
Diffstat (limited to 'jstests')
-rw-r--r--jstests/core/index_bigkeys.js2
-rw-r--r--jstests/core/index_bigkeys_background.js21
-rw-r--r--jstests/libs/index_bigkeys.js14
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.