diff options
author | Jordi Olivares Provencio <jordi.olivares-provencio@mongodb.com> | 2022-02-15 17:22:30 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-15 19:38:37 +0000 |
commit | ec39d9e620d0e848d21ff3d0c0de8c4b57682622 (patch) | |
tree | f750a44a1a422db3807f17730c5c025f6e403dde | |
parent | c54aa67c44f81d3a1ea8fc3832c88eec41cda36b (diff) | |
download | mongo-ec39d9e620d0e848d21ff3d0c0de8c4b57682622.tar.gz |
SERVER-63246 Modify CRUD_clustered_collection for parallel FSM tests
-rw-r--r-- | jstests/concurrency/fsm_workloads/CRUD_clustered_collection.js | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/jstests/concurrency/fsm_workloads/CRUD_clustered_collection.js b/jstests/concurrency/fsm_workloads/CRUD_clustered_collection.js index 7a31d7f5fff..351bd0bfbb1 100644 --- a/jstests/concurrency/fsm_workloads/CRUD_clustered_collection.js +++ b/jstests/concurrency/fsm_workloads/CRUD_clustered_collection.js @@ -38,27 +38,19 @@ var $config = extendWorkload($config, function($config, $super) { // As the default collection created by runner.js won't be clustered we need to recreate it. db[coll].drop(); - cluster.executeOnMongodNodes(function(nodeAdminDB) { - assert.commandWorked(nodeAdminDB.runCommand( - {configureFailPoint: 'clusterAllCollectionsByDefault', mode: 'alwaysOn'})); - }); - - $super.setup.apply(this, [db, coll, cluster]); + assertAlways.commandWorked( + db.runCommand({create: coll, clusteredIndex: {key: {_id: 1}, unique: true}})); + for (let i = 0; i < this.numIds; i++) { + const res = db[coll].insert({_id: i, value: this.docValue, num: 1}); + assertAlways.commandWorked(res); + assert.eq(1, res.nInserted); + } if (cluster.isSharded()) { cluster.shardCollection(db[coll], {_id: 1}, true); } }; - $config.teardown = function(db, collName, cluster) { - $super.teardown.apply(this, [db, collName, cluster]); - - cluster.executeOnMongodNodes(function(nodeAdminDB) { - assert.commandWorked(nodeAdminDB.runCommand( - {configureFailPoint: 'clusterAllCollectionsByDefault', mode: 'off'})); - }); - }; - // Exclude dropCollection to prevent implicit collection creation of a non-clustered // collection. const newTransitions = Object.extend({}, $super.transitions); |