summaryrefslogtreecommitdiff
path: root/jstests/sharding/failcommand_failpoint_not_parallel.js
blob: 18117e0e4b8ff326e274478944672ebec0b70f3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(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();
}());