summaryrefslogtreecommitdiff
path: root/jstests/sharding/write_concern_basic.js
diff options
context:
space:
mode:
authorShreyas Kalyan <shreyas.kalyan@10gen.com>2021-01-27 14:29:58 -0800
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-02 03:58:02 +0000
commitf14dd6bfe5144612dbcd66986cda7b068cf886ef (patch)
treee51f22542027ef15b7000d835932cad0f82e6c03 /jstests/sharding/write_concern_basic.js
parent3615d707c495af3019344dc8878259ff362607d1 (diff)
downloadmongo-f14dd6bfe5144612dbcd66986cda7b068cf886ef.tar.gz
SERVER-53785 Test WriteConcernErrors are preserved with the mongos implementation of drop command
Diffstat (limited to 'jstests/sharding/write_concern_basic.js')
-rw-r--r--jstests/sharding/write_concern_basic.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/jstests/sharding/write_concern_basic.js b/jstests/sharding/write_concern_basic.js
new file mode 100644
index 00000000000..ae27edad6cd
--- /dev/null
+++ b/jstests/sharding/write_concern_basic.js
@@ -0,0 +1,20 @@
+// Test that certain basic commands preserve write concern errors.
+// @tags: [ requires_fcv_49, ]
+//
+
+(function() {
+"use strict";
+
+load("jstests/sharding/libs/failpoint_helpers.js");
+
+let st = new ShardingTest({shards: 1, config: 1});
+
+{
+ let db = st.s.getDB("test");
+ failCommandsWithWriteConcernError(st.rs0, ["drop", "_shardsvrDropCollectionParticipant"]);
+ assert.commandWorked(db.collection.insert({"a": 1}));
+ assert.commandFailedWithCode(db.runCommand({drop: "collection"}), 12345);
+}
+
+st.stop();
+})(); \ No newline at end of file