diff options
author | Shreyas Kalyan <shreyas.kalyan@10gen.com> | 2021-02-02 19:43:32 -0800 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-06 02:23:17 +0000 |
commit | e55712f847134083ecd989e3f344ee3d87ec711c (patch) | |
tree | 0375efb845bc1930f193dabdb25d0bb733209750 | |
parent | 395a73ccd6d053c964de7f0fe4f16920cb40350a (diff) | |
download | mongo-e55712f847134083ecd989e3f344ee3d87ec711c.tar.gz |
SERVER-53786 Test WriteConcernErrors are preserved with the mongos implementation of dropDatabases command
-rw-r--r-- | jstests/sharding/write_concern_basic.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/jstests/sharding/write_concern_basic.js b/jstests/sharding/write_concern_basic.js index ae27edad6cd..c24f5a51028 100644 --- a/jstests/sharding/write_concern_basic.js +++ b/jstests/sharding/write_concern_basic.js @@ -9,11 +9,24 @@ load("jstests/sharding/libs/failpoint_helpers.js"); let st = new ShardingTest({shards: 1, config: 1}); +// Test drop collection { let db = st.s.getDB("test"); + // _shardsvrDropCollectionParticipant required for PM-1965 failCommandsWithWriteConcernError(st.rs0, ["drop", "_shardsvrDropCollectionParticipant"]); assert.commandWorked(db.collection.insert({"a": 1})); assert.commandFailedWithCode(db.runCommand({drop: "collection"}), 12345); + turnOffFailCommand(st.rs0); +} + +// Test drop database +{ + let db = st.s.getDB("test"); + // _shardsvrDropDatabaseParticipant required for PM-1965 + failCommandsWithWriteConcernError(st.rs0, ["dropDatabase", "_shardsvrDropDatabaseParticipant"]); + assert.commandWorked(db.collection.insert({"a": 1})); + assert.commandFailedWithCode(db.runCommand({"dropDatabase": 1}), 12345); + turnOffFailCommand(st.rs0); } st.stop(); |