summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2021-03-19 18:01:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-23 23:46:02 +0000
commita97002800ba3597cea321cae42298da4a3b12626 (patch)
tree9d1b64db37b48d8bc46d5157ab12380669b857b9
parentb2361765cd57a3ed5756ceb0ab9dac3d315231d9 (diff)
downloadmongo-a97002800ba3597cea321cae42298da4a3b12626.tar.gz
SERVER-55370 Fix drop_indexes_aborts_in_progress_index_builds_wildcard.js behaviour with BackgroundOperationInProgressForNamespace
-rw-r--r--jstests/noPassthrough/drop_indexes_aborts_in_progress_index_builds_wildcard.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/jstests/noPassthrough/drop_indexes_aborts_in_progress_index_builds_wildcard.js b/jstests/noPassthrough/drop_indexes_aborts_in_progress_index_builds_wildcard.js
index 5bf8855d620..5de783fd099 100644
--- a/jstests/noPassthrough/drop_indexes_aborts_in_progress_index_builds_wildcard.js
+++ b/jstests/noPassthrough/drop_indexes_aborts_in_progress_index_builds_wildcard.js
@@ -26,7 +26,6 @@ testDB.getCollection(collName).drop();
assert.commandWorked(testDB.createCollection(collName));
const coll = testDB.getCollection(collName);
-jsTest.log("Aborting all index builders and ready indexes with '*' wildcard");
assert.commandWorked(testDB.getCollection(collName).insert({a: 1}));
assert.commandWorked(testDB.getCollection(collName).insert({b: 1}));
@@ -42,18 +41,15 @@ const awaitSecondIndexBuild = IndexBuildTest.startIndexBuild(
testDB.getMongo(), coll.getFullName(), {b: 1}, {}, [ErrorCodes.IndexBuildAborted]);
IndexBuildTest.waitForIndexBuildToScanCollection(testDB, collName, "b_1");
-const awaitDropIndex = startParallelShell(() => {
- const testDB = db.getSiblingDB(TestData.dbName);
- assert.commandWorked(testDB.runCommand({dropIndexes: TestData.collName, index: "*"}));
-}, conn.port);
-
+jsTest.log("Aborting all index builders and ready indexes with '*' wildcard");
+assert.commandWorked(testDB.runCommand({dropIndexes: collName, index: "*"}));
checkLog.containsJson(testDB.getMongo(), 23879); // "About to abort all index builders"
+
IndexBuildTest.resumeIndexBuilds(testDB.getMongo());
awaitFirstIndexBuild();
awaitSecondIndexBuild();
-awaitDropIndex();
-assert.eq(1, testDB.getCollection(collName).getIndexes().length);
+assert.eq(1, testDB.getCollection(collName).getIndexes().length); // _id index
MongoRunner.stopMongod(conn);
}());