mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
22 lines
744 B
JavaScript
22 lines
744 B
JavaScript
(function() {
|
|
"use strict";
|
|
|
|
const st = new ShardingTest({shards: 3, mongos: 1});
|
|
const db = st.s.getDB("test_failcommand_noparallel");
|
|
|
|
// Test times when closing connection.
|
|
// Sharding tests require failInternalCommands: true, since the mongos appears to mongod to be
|
|
// an internal client.
|
|
assert.commandWorked(st.s.adminCommand({
|
|
configureFailPoint: "failCommand",
|
|
mode: {times: 2},
|
|
data: {closeConnection: true, failCommands: ["find"], failInternalCommands: true}
|
|
}));
|
|
assert.throws(() => db.runCommand({find: "c"}));
|
|
assert.throws(() => db.runCommand({find: "c"}));
|
|
assert.commandWorked(db.runCommand({find: "c"}));
|
|
assert.commandWorked(st.s.adminCommand({configureFailPoint: "failCommand", mode: "off"}));
|
|
|
|
st.stop();
|
|
}());
|