0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 01:21:03 +01:00
mongodb/jstests/noPassthrough/failcommand_failpoint_not_parallel.js
2019-07-27 11:02:23 -04:00

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);
}());