From 55ba2b4965904691412da01123deb10984cae2ff Mon Sep 17 00:00:00 2001 From: Tommaso Tocci Date: Mon, 7 Mar 2022 18:35:46 +0000 Subject: SERVER-64230 Convert jstests/core/remove9.js to FSM workload --- .../suites/change_streams_downgrade.yml | 1 - .../suites/cst_jscore_passthrough.yml | 2 - ...ead_write_multi_stmt_txn_jscore_passthrough.yml | 1 - ...lti_shard_multi_stmt_txn_jscore_passthrough.yml | 1 - ...ti_stmt_txn_kill_primary_jscore_passthrough.yml | 1 - ...tmt_txn_stepdown_primary_jscore_passthrough.yml | 1 - ..._stmt_txn_jscore_passthrough_with_migration.yml | 1 - ...lica_sets_multi_stmt_txn_jscore_passthrough.yml | 1 - ...ti_stmt_txn_kill_primary_jscore_passthrough.yml | 1 - ..._multi_stmt_txn_stepdown_jscore_passthrough.yml | 1 - ...mt_txn_terminate_primary_jscore_passthrough.yml | 1 - .../sharded_multi_stmt_txn_jscore_passthrough.yml | 1 - ...migration_multi_stmt_txn_jscore_passthrough.yml | 1 - jstests/concurrency/fsm_workloads/count_odd.js | 56 ++++++++++++++++++++++ jstests/core/remove9.js | 39 --------------- 15 files changed, 56 insertions(+), 53 deletions(-) create mode 100644 jstests/concurrency/fsm_workloads/count_odd.js delete mode 100644 jstests/core/remove9.js diff --git a/buildscripts/resmokeconfig/suites/change_streams_downgrade.yml b/buildscripts/resmokeconfig/suites/change_streams_downgrade.yml index 488019780b5..a5e5485e46d 100644 --- a/buildscripts/resmokeconfig/suites/change_streams_downgrade.yml +++ b/buildscripts/resmokeconfig/suites/change_streams_downgrade.yml @@ -241,7 +241,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml index 47561591768..0f99b90377f 100755 --- a/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/cst_jscore_passthrough.yml @@ -369,7 +369,6 @@ selector: - jstests/core/remove3.js - jstests/core/remove6.js - jstests/core/remove7.js - - jstests/core/remove9.js - jstests/core/removea.js - jstests/core/removeb.js - jstests/core/removec.js @@ -630,7 +629,6 @@ selector: - jstests/core/regex_verbs.js - jstests/core/regexb.js - jstests/core/regexc.js - - jstests/core/remove9.js - jstests/core/server7756.js - jstests/core/sortk.js - jstests/core/system_js_access.js diff --git a/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml index 9a683d520e2..fc9f0207de7 100644 --- a/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/multi_shard_local_read_write_multi_stmt_txn_jscore_passthrough.yml @@ -226,7 +226,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml index 8a516d6f057..07e839d9b77 100644 --- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_jscore_passthrough.yml @@ -249,7 +249,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml index 2c8e1ddfaa3..26d4fc14d97 100644 --- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_kill_primary_jscore_passthrough.yml @@ -241,7 +241,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml index 17b80e2c1ab..84d46018091 100644 --- a/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/multi_shard_multi_stmt_txn_stepdown_primary_jscore_passthrough.yml @@ -241,7 +241,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml b/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml index aacde719bd6..ccdf9fcec1b 100644 --- a/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml +++ b/buildscripts/resmokeconfig/suites/multi_stmt_txn_jscore_passthrough_with_migration.yml @@ -257,7 +257,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml index 0dc91aa8516..39549ffe941 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_jscore_passthrough.yml @@ -202,7 +202,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml index 6ed257b9f37..780cf31a717 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_kill_primary_jscore_passthrough.yml @@ -185,7 +185,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml index ca3b54c3e4f..8edf927513e 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_stepdown_jscore_passthrough.yml @@ -185,7 +185,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml index 7b8b7b3976e..2fad03caff8 100644 --- a/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/replica_sets_multi_stmt_txn_terminate_primary_jscore_passthrough.yml @@ -183,7 +183,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml index 0e199bff5e3..2c0dd75a63c 100644 --- a/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/sharded_multi_stmt_txn_jscore_passthrough.yml @@ -222,7 +222,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml b/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml index 652d6f899d8..5189e1e1d68 100644 --- a/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml +++ b/buildscripts/resmokeconfig/suites/tenant_migration_multi_stmt_txn_jscore_passthrough.yml @@ -302,7 +302,6 @@ selector: - jstests/core/killop_drop_collection.js - jstests/core/loadserverscripts.js - jstests/core/mr_killop.js - - jstests/core/remove9.js - jstests/core/removeb.js - jstests/core/removec.js - jstests/core/shellstartparallel.js diff --git a/jstests/concurrency/fsm_workloads/count_odd.js b/jstests/concurrency/fsm_workloads/count_odd.js new file mode 100644 index 00000000000..666f65fe66c --- /dev/null +++ b/jstests/concurrency/fsm_workloads/count_odd.js @@ -0,0 +1,56 @@ +'use strict'; + +/** + * count_odd.js + * + * Count odd numbered entries while updating and deleting even numbered entries. + * + * @tags: [ + * requires_non_retryable_writes, + * ] + * + */ +var $config = (function() { + var states = (function() { + function init(db, collName) { + } + + function write(db, collName) { + const coll = db[collName]; + const i = Random.randInt(499) * 2; + assertAlways.writeOK(coll.update({i: i}, {$set: {i: 2000}}, {multi: true})); + assertAlways.writeOK(coll.remove({i: 2000})); + assertAlways.writeOK(coll.save({i: i})); + } + + function count(db, collName) { + const num_odd_doc = db[collName].countDocuments({i: {$mod: [2, 1]}}); + assertAlways.eq(500, num_odd_doc); + } + + return {init: init, write: write, count: count}; + })(); + + let setup = function(db, collName) { + assert.commandWorked(db[collName].createIndex({i: 1})); + const bulk = db[collName].initializeUnorderedBulkOp(); + for (let i = 0; i < 1000; ++i) { + bulk.insert({i: i}); + } + assert.commandWorked(bulk.execute()); + }; + + let transitions = { + init: {write: 0.5, count: 0.5}, + write: {write: 0.5, count: 0.5}, + count: {write: 0.5, count: 0.5} + }; + + return { + threadCount: 10, + iterations: 20, + states: states, + setup: setup, + transitions: transitions + }; +})(); diff --git a/jstests/core/remove9.js b/jstests/core/remove9.js deleted file mode 100644 index ce8e714eccf..00000000000 --- a/jstests/core/remove9.js +++ /dev/null @@ -1,39 +0,0 @@ -// @tags: [ -// requires_getmore, -// requires_non_retryable_writes, -// uses_multiple_connections, -// uses_parallel_shell, -// ] - -// SERVER-2009 Count odd numbered entries while updating and deleting even numbered entries. - -(function() { -"use strict"; - -const t = db.jstests_remove9; -t.drop(); -t.createIndex({i: 1}); - -const bulk = t.initializeUnorderedBulkOp(); -for (let i = 0; i < 1000; ++i) { - bulk.insert({i: i}); -} -assert.commandWorked(bulk.execute()); - -const s = startParallelShell(function() { - const t = db.jstests_remove9; - Random.setRandomSeed(); - for (let j = 0; j < 5000; ++j) { - const i = Random.randInt(499) * 2; - t.update({i: i}, {$set: {i: 2000}}); - t.remove({i: 2000}); - t.save({i: i}); - } -}); - -for (let i = 0; i < 1000; ++i) { - assert.eq(500, t.find({i: {$gte: 0, $mod: [2, 1]}}).hint({i: 1}).itcount()); -} - -s(); -})(); -- cgit v1.2.1