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

}());