blob: a9d776d007918786b1de14c6a0cd9a651bad7081 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
(function() {
"use strict";
const conn = MongoRunner.runMongod();
assert.neq(null, conn);
const db = conn.getDB("test_failcommand_noparallel");
// Test times when closing connection.
assert.commandWorked(db.adminCommand({
configureFailPoint: "failCommand",
mode: {times: 2},
data: {
closeConnection: true,
failCommands: ["find"],
}
}));
assert.throws(() => db.runCommand({find: "c"}));
assert.throws(() => db.runCommand({find: "c"}));
assert.commandWorked(db.runCommand({find: "c"}));
assert.commandWorked(db.adminCommand({configureFailPoint: "failCommand", mode: "off"}));
MongoRunner.stopMongod(conn);
}());
|