summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/dropcollection_duplicate_fields.js
blob: 22e7c3fdeebc157c70340b547a43601f3cf9423d (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
25
26
27
28
/*
 * SERVER-35172: Test that dropCollection does not return a message containing multiple "ns" fields
 * @tags: [requires_wiredtiger]
 */

(function() {
"use strict";
var conn = MongoRunner.runMongod();
var db = conn.getDB('test');

let coll = db.dropcollection_duplicate_fields;
// Repeat 100 times for the sake of probabilities
for (let i = 0; i < 100; i++) {
    coll.drop();
    coll.insert({x: 1});

    assert.commandWorked(db.adminCommand(
        {configureFailPoint: 'WTWriteConflictException', mode: {activationProbability: 0.1}}));

    // will blow up if res is not valid
    let res = db.runCommand({drop: 'dropcollection_duplicate_fields'});

    assert.commandWorked(
        db.adminCommand({configureFailPoint: 'WTWriteConflictException', mode: "off"}));
}

MongoRunner.stopMongod(conn);
})();