From 7d255086ddb335230b1373d5593e65cdc7ba45c3 Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Wed, 27 Jun 2018 11:33:18 -0400 Subject: SERVER-35847 Remove eval command and remove/update related tests/helpers --- .../fsm_workloads/indexed_insert_eval.js | 33 ------------------- .../fsm_workloads/indexed_insert_eval_nolock.js | 18 ----------- .../fsm_workloads/remove_single_document_eval.js | 37 ---------------------- .../remove_single_document_eval_nolock.js | 16 ---------- .../fsm_workloads/update_simple_eval.js | 33 ------------------- .../fsm_workloads/update_simple_eval_nolock.js | 16 ---------- 6 files changed, 153 deletions(-) delete mode 100644 jstests/concurrency/fsm_workloads/indexed_insert_eval.js delete mode 100644 jstests/concurrency/fsm_workloads/indexed_insert_eval_nolock.js delete mode 100644 jstests/concurrency/fsm_workloads/remove_single_document_eval.js delete mode 100644 jstests/concurrency/fsm_workloads/remove_single_document_eval_nolock.js delete mode 100644 jstests/concurrency/fsm_workloads/update_simple_eval.js delete mode 100644 jstests/concurrency/fsm_workloads/update_simple_eval_nolock.js (limited to 'jstests/concurrency') 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; -}); -- cgit v1.2.1