summaryrefslogtreecommitdiff
path: root/jstests/concurrency
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2018-06-27 11:33:18 -0400
committerSara Golemon <sara.golemon@mongodb.com>2018-06-29 23:02:02 -0400
commit7d255086ddb335230b1373d5593e65cdc7ba45c3 (patch)
treed341ca4d62e080746ab8322f21e75e91e538cfd1 /jstests/concurrency
parent821f9f69916da51f97e001b1c45dff6e49533f81 (diff)
downloadmongo-7d255086ddb335230b1373d5593e65cdc7ba45c3.tar.gz
SERVER-35847 Remove eval command and remove/update related tests/helpers
Diffstat (limited to 'jstests/concurrency')
-rw-r--r--jstests/concurrency/fsm_workloads/indexed_insert_eval.js33
-rw-r--r--jstests/concurrency/fsm_workloads/indexed_insert_eval_nolock.js18
-rw-r--r--jstests/concurrency/fsm_workloads/remove_single_document_eval.js37
-rw-r--r--jstests/concurrency/fsm_workloads/remove_single_document_eval_nolock.js16
-rw-r--r--jstests/concurrency/fsm_workloads/update_simple_eval.js33
-rw-r--r--jstests/concurrency/fsm_workloads/update_simple_eval_nolock.js16
6 files changed, 0 insertions, 153 deletions
diff --git a/jstests/concurrency/fsm_workloads/indexed_insert_eval.js b/jstests/concurrency/fsm_workloads/indexed_insert_eval.js
deleted file mode 100644
index f35d4565e3b..00000000000
--- a/jstests/concurrency/fsm_workloads/indexed_insert_eval.js
+++ /dev/null
@@ -1,33 +0,0 @@
-'use strict';
-
-/**
- * indexed_insert_eval.js
- *
- * Inserts multiple documents into an indexed collection using the eval command.
- * Asserts that all documents appear in both a collection scan and an index
- * scan. The indexed value is the thread id.
- */
-load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
-load('jstests/concurrency/fsm_workloads/indexed_insert_base.js'); // for $config
-
-var $config = extendWorkload($config, function($config, $super) {
-
- $config.data.nolock = false;
-
- $config.states.insert = function insert(db, collName) {
- var evalResult = db.runCommand({
- eval: function(collName, doc) {
- var insertResult = db[collName].insert(doc);
- return tojson(insertResult);
- },
- args: [collName, this.getDoc()],
- nolock: this.nolock
- });
- assertAlways.commandWorked(evalResult);
- var insertResult = JSON.parse(evalResult.retval);
- assertAlways.eq(1, insertResult.nInserted, tojson(insertResult));
- this.nInserted += this.docsPerInsert;
- };
-
- return $config;
-});
diff --git a/jstests/concurrency/fsm_workloads/indexed_insert_eval_nolock.js b/jstests/concurrency/fsm_workloads/indexed_insert_eval_nolock.js
deleted file mode 100644
index f87ba5da790..00000000000
--- a/jstests/concurrency/fsm_workloads/indexed_insert_eval_nolock.js
+++ /dev/null
@@ -1,18 +0,0 @@
-'use strict';
-
-/**
- * indexed_insert_eval_nolock.js
- *
- * Inserts multiple documents into an indexed collection using the eval command
- * with the option { nolock: true }. Asserts that all documents appear in both a
- * collection scan and an index scan. The indexed value is the thread id.
- */
-load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
-load('jstests/concurrency/fsm_workloads/indexed_insert_eval.js'); // for $config
-
-var $config = extendWorkload($config, function($config, $super) {
-
- $config.data.nolock = true;
-
- return $config;
-});
diff --git a/jstests/concurrency/fsm_workloads/remove_single_document_eval.js b/jstests/concurrency/fsm_workloads/remove_single_document_eval.js
deleted file mode 100644
index 3109c743e29..00000000000
--- a/jstests/concurrency/fsm_workloads/remove_single_document_eval.js
+++ /dev/null
@@ -1,37 +0,0 @@
-'use strict';
-
-/**
- * remove_single_document_eval.js
- *
- * Runs remove_single_document using the eval command.
- */
-load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
-load('jstests/concurrency/fsm_workloads/remove_single_document.js'); // for $config
-
-var $config = extendWorkload($config, function($config, $super) {
-
- $config.data.doRemove = function doRemove(db, collName, query, options) {
- var evalResult = db.runCommand({
- eval: function(f, collName, query, options) {
- return tojson(f(db, collName, query, options));
- },
- args: [$super.data.doRemove, collName, query, options],
- nolock: this.nolock
- });
- assertAlways.commandWorked(evalResult);
- var res = JSON.parse(evalResult.retval);
- return res;
- };
-
- $config.data.assertResult = function assertResult(res) {
- assertWhenOwnColl.eq(1, res.nRemoved, tojson(res));
- };
-
- $config.data.nolock = false;
-
- // scale down threadCount and iterations because eval takes a global lock
- $config.threadCount = 5;
- $config.iterations = 10;
-
- return $config;
-});
diff --git a/jstests/concurrency/fsm_workloads/remove_single_document_eval_nolock.js b/jstests/concurrency/fsm_workloads/remove_single_document_eval_nolock.js
deleted file mode 100644
index a3f67c26892..00000000000
--- a/jstests/concurrency/fsm_workloads/remove_single_document_eval_nolock.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-
-/**
- * remove_single_document_eval_nolock.js
- *
- * Runs remove_single_document_eval with the eval option { nolock: true }.
- */
-load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
-load('jstests/concurrency/fsm_workloads/remove_single_document_eval.js'); // for $config
-
-var $config = extendWorkload($config, function($config, $super) {
-
- $config.data.nolock = true;
-
- return $config;
-});
diff --git a/jstests/concurrency/fsm_workloads/update_simple_eval.js b/jstests/concurrency/fsm_workloads/update_simple_eval.js
deleted file mode 100644
index f8b9115e455..00000000000
--- a/jstests/concurrency/fsm_workloads/update_simple_eval.js
+++ /dev/null
@@ -1,33 +0,0 @@
-'use strict';
-
-/**
- * update_eval.js
- *
- * Creates several docs. On each iteration, each thread chooses:
- * - a random doc
- * - whether to $set or $unset its field
- * - what value to $set the field to
- * and then applies the update using db.runCommand({ eval: ... })
- */
-load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
-load('jstests/concurrency/fsm_workloads/update_simple.js'); // for $config
-
-var $config = extendWorkload($config, function($config, $super) {
-
- $config.data.doUpdate = function doUpdate(db, collName, query, updater) {
- var evalResult = db.runCommand({
- eval: function(f, collName, query, updater) {
- return tojson(f(db, collName, query, updater));
- },
- args: [$super.data.doUpdate, collName, query, updater],
- nolock: this.nolock
- });
- assertAlways.commandWorked(evalResult);
- var res = JSON.parse(evalResult.retval);
- return res;
- };
-
- $config.data.nolock = false;
-
- return $config;
-});
diff --git a/jstests/concurrency/fsm_workloads/update_simple_eval_nolock.js b/jstests/concurrency/fsm_workloads/update_simple_eval_nolock.js
deleted file mode 100644
index c5f081088cd..00000000000
--- a/jstests/concurrency/fsm_workloads/update_simple_eval_nolock.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-
-/**
- * update_simple_eval_nolock.js
- *
- * Runs update_simple_eval with the eval option { nolock: true }.
- */
-load('jstests/concurrency/fsm_libs/extend_workload.js'); // for extendWorkload
-load('jstests/concurrency/fsm_workloads/update_simple_eval.js'); // for $config
-
-var $config = extendWorkload($config, function($config, $super) {
-
- $config.data.nolock = true;
-
- return $config;
-});