summaryrefslogtreecommitdiff
path: root/jstests/concurrency/fsm_workloads/map_reduce_inline.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/concurrency/fsm_workloads/map_reduce_inline.js')
-rw-r--r--jstests/concurrency/fsm_workloads/map_reduce_inline.js18
1 files changed, 8 insertions, 10 deletions
diff --git a/jstests/concurrency/fsm_workloads/map_reduce_inline.js b/jstests/concurrency/fsm_workloads/map_reduce_inline.js
index 94382b1fe70..268fc1460d7 100644
--- a/jstests/concurrency/fsm_workloads/map_reduce_inline.js
+++ b/jstests/concurrency/fsm_workloads/map_reduce_inline.js
@@ -61,25 +61,23 @@ var $config = (function() {
var transitions = {init: {mapReduce: 1}, mapReduce: {mapReduce: 1}};
- function makeDoc(keyLimit, valueLimit) {
- return {
- _id: new ObjectId(),
- key: Random.randInt(keyLimit),
- value: Random.randInt(valueLimit)
- };
- }
-
function setup(db, collName, cluster) {
var bulk = db[collName].initializeUnorderedBulkOp();
for (var i = 0; i < this.numDocs; ++i) {
// TODO: this actually does assume that there are no unique indexes
- var doc = makeDoc(this.numDocs / 100, this.numDocs / 10);
- bulk.insert(doc);
+ bulk.insert({
+ _id: i,
+ key: Random.randInt(this.numDocs / 100),
+ value: Random.randInt(this.numDocs / 10)
+ });
}
var res = bulk.execute();
assertAlways.commandWorked(res);
assertAlways.eq(this.numDocs, res.nInserted);
+
+ assert.commandWorked(
+ db.adminCommand({setParameter: 1, internalQueryUseAggMapReduce: true}));
}
return {