summaryrefslogtreecommitdiff
path: root/jstests/concurrency/fsm_workloads/touch_no_data_no_index.js
blob: 18cf0329b02b432487610d33a7fe07bec7884295 (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
'use strict';

/**
 * touch_no_data_no_index.js
 *
 * Bulk inserts documents in batches of 100, uses touch as a no-op,
 * and queries to verify the number of documents inserted by the thread. 
 */

load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
load('jstests/concurrency/fsm_workloads/touch_base.js'); // for $config

var $config = extendWorkload($config, function($config, $super) {
    $config.data.generateTouchCmdObj = function generateTouchCmdObj(collName) {
        return { touch: collName, data: false, index: false };
    };

    $config.states.touch = function touch(db, collName) {
        var res = db.runCommand(this.generateTouchCmdObj(collName));
        // The command always fails because "index" and "data" are both false
        assertAlways.commandFailed(res);
    };

    return $config;
});