mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
24 lines
645 B
JavaScript
24 lines
645 B
JavaScript
(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);
|
|
}());
|