summaryrefslogtreecommitdiff
path: root/jstests/libs/override_methods/set_read_and_write_concerns.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/libs/override_methods/set_read_and_write_concerns.js')
-rw-r--r--jstests/libs/override_methods/set_read_and_write_concerns.js30
1 files changed, 26 insertions, 4 deletions
diff --git a/jstests/libs/override_methods/set_read_and_write_concerns.js b/jstests/libs/override_methods/set_read_and_write_concerns.js
index 30c853fb54b..267b5ab9bfc 100644
--- a/jstests/libs/override_methods/set_read_and_write_concerns.js
+++ b/jstests/libs/override_methods/set_read_and_write_concerns.js
@@ -57,6 +57,31 @@
"updateUser",
]);
+ const kCommandsToEmulateWriteConcern = new Set([
+ "aggregate",
+ "appendOplogNote",
+ "captrunc",
+ "cleanupOrphaned",
+ "clone",
+ "cloneCollection",
+ "cloneCollectionAsCapped",
+ "convertToCapped",
+ "copydb",
+ "create",
+ "createIndexes",
+ "drop",
+ "dropDatabase",
+ "dropIndexes",
+ "emptycapped",
+ "godinsert",
+ "mapReduce",
+ "mapreduce",
+ "mapreduce.shardedfinish",
+ "moveChunk",
+ "renameCollection",
+ "revokePrivilegesFromRole",
+ ]);
+
function runCommandWithReadAndWriteConcerns(
conn, dbName, commandName, commandObj, func, makeFuncArgs) {
if (typeof commandObj !== "object" || commandObj === null) {
@@ -79,10 +104,7 @@
var shouldForceReadConcern = kCommandsSupportingReadConcern.has(commandName);
var shouldForceWriteConcern = kCommandsSupportingWriteConcern.has(commandName);
- var shouldEmulateWriteConcern =
- (commandName === "aggregate" || commandName === "createIndexes" ||
- commandName === "mapReduce" || commandName === "mapreduce" ||
- commandName === "mapreduce.shardedfinish");
+ var shouldEmulateWriteConcern = kCommandsToEmulateWriteConcern.has(commandName);
if (commandName === "aggregate") {
if (OverrideHelpers.isAggregationWithOutStage(commandName, commandObjUnwrapped)) {