diff options
author | James Wahlin <james@mongodb.com> | 2017-12-01 15:41:07 -0500 |
---|---|---|
committer | James Wahlin <james@mongodb.com> | 2017-12-08 16:59:01 -0500 |
commit | 38cf9e8f43033d0fab3dc716a727626c66d4412e (patch) | |
tree | faa44d0b3a5a6884825c0568684059793165c9f0 /jstests/concurrency | |
parent | 8ad0b45e240866db54f13556078c9df4e0247f4c (diff) | |
download | mongo-38cf9e8f43033d0fab3dc716a727626c66d4412e.tar.gz |
SERVER-32053 Make explain cursor invalidation testing more reliable
(cherry picked from commit 7920e242c0def907b502265ca14ddf3d86c98025)
Diffstat (limited to 'jstests/concurrency')
-rw-r--r-- | jstests/concurrency/fsm_workloads/invalidated_cursors.js | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/jstests/concurrency/fsm_workloads/invalidated_cursors.js b/jstests/concurrency/fsm_workloads/invalidated_cursors.js index e7359c77263..6a40a8086ad 100644 --- a/jstests/concurrency/fsm_workloads/invalidated_cursors.js +++ b/jstests/concurrency/fsm_workloads/invalidated_cursors.js @@ -4,8 +4,8 @@ * invalidated_cursors.js * * This workload was designed to stress creating, pinning, and invalidating cursors through the - * cursor manager. Threads perform finds and getMores while the database, collection, or an index - * is dropped. + * cursor manager. Threads perform find, getMore and explain commands while the database, + * collection, or an index is dropped. */ var $config = (function() { @@ -20,7 +20,7 @@ var $config = (function() { involvedCollections: ['coll0', 'coll1', 'coll2'], indexSpecs: [{a: 1, b: 1}, {c: 1}], - numDocs: 10, + numDocs: 100, batchSize: 2, /** @@ -66,6 +66,18 @@ var $config = (function() { } }, + /** + * Explains a find on a collection. + */ + explain: function explain(db, collName) { + let myDB = db.getSiblingDB(this.uniqueDBName); + let res = myDB.runCommand({ + explain: {find: this.chooseRandomlyFrom(this.involvedCollections), filter: {}}, + verbosity: "executionStats" + }); + assertAlways.commandWorked(res); + }, + killCursor: function killCursor(db, collName) { if (this.hasOwnProperty('cursor')) { this.cursor.close(); @@ -150,13 +162,15 @@ var $config = (function() { let transitions = { init: { - query: 0.7, + query: 0.6, + explain: 0.1, dropDatabase: 0.1, dropCollection: 0.1, dropIndex: 0.1, }, query: {killCursor: 0.1, getMore: 0.9}, + explain: {explain: 0.1, init: 0.9}, killCursor: {init: 1}, getMore: {killCursor: 0.2, getMore: 0.6, init: 0.2}, dropDatabase: {init: 1}, |