diff options
Diffstat (limited to 'jstests/core')
3 files changed, 14 insertions, 4 deletions
diff --git a/jstests/core/txns/noop_createIndexes_not_blocked_by_txn.js b/jstests/core/txns/noop_createIndexes_not_blocked_by_txn.js index ebf1b232ff7..ef03baab8cd 100644 --- a/jstests/core/txns/noop_createIndexes_not_blocked_by_txn.js +++ b/jstests/core/txns/noop_createIndexes_not_blocked_by_txn.js @@ -24,7 +24,8 @@ if (isMongos) { const createIndexesCommand = { createIndexes: collName, - indexes: [{key: {a: 1}, name: "a_1"}] + indexes: [{key: {a: 1}, name: "a_1"}], + writeConcern: {w: 'majority'}, }; assert.commandWorked(sessionDB.runCommand(createIndexesCommand)); diff --git a/jstests/core/txns/prepared_transactions_do_not_block_non_conflicting_ddl.js b/jstests/core/txns/prepared_transactions_do_not_block_non_conflicting_ddl.js index 0458f213960..1f13af52e0f 100644 --- a/jstests/core/txns/prepared_transactions_do_not_block_non_conflicting_ddl.js +++ b/jstests/core/txns/prepared_transactions_do_not_block_non_conflicting_ddl.js @@ -40,7 +40,8 @@ testSuccess(otherDBName, createCmd); jsTest.log("Test 'createIndexes'."); const createIndexesCmd = { createIndexes: collName, - indexes: [{key: {x: 1}, name: "x_1"}] + indexes: [{key: {x: 1}, name: "x_1"}], + writeConcern: {w: 'majority'}, }; testSuccess(otherDBName, createIndexesCmd); @@ -51,7 +52,11 @@ const dropIndexesCmd = { }; testSuccess(otherDBName, dropIndexesCmd); -sessionColl.createIndex({multiKeyField: 1}); +assert.commandWorked(sessionDB.runCommand({ + createIndexes: collName, + indexes: [{name: 'multiKeyField_1', key: {multiKeyField: 1}}], + writeConcern: {w: 'majority'}, +})); jsTest.log("Test 'insert' that enables multi-key index on the same collection."); const insertAndSetMultiKeyCmd = { insert: collName, diff --git a/jstests/core/txns/read_own_multikey_writes.js b/jstests/core/txns/read_own_multikey_writes.js index 1c3dc450280..0def1cdf759 100644 --- a/jstests/core/txns/read_own_multikey_writes.js +++ b/jstests/core/txns/read_own_multikey_writes.js @@ -16,7 +16,11 @@ const sessionColl = sessionDb.getCollection(collName); assert.commandWorked(sessionDb.runCommand({create: collName})); assert.commandWorked(sessionColl.insert({a: 1})); -assert.commandWorked(sessionColl.createIndex({a: 1})); +assert.commandWorked(sessionDb.runCommand({ + createIndexes: collName, + indexes: [{name: 'a_1', key: {a: 1}}], + writeConcern: {w: 'majority'}, +})); session.startTransaction(); assert.commandWorked(sessionColl.update({}, {$set: {a: [1, 2, 3]}})); |