summaryrefslogtreecommitdiff
path: root/jstests/concurrency
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2019-03-06 11:36:30 -0500
committerJack Mulrow <jack.mulrow@mongodb.com>2019-04-22 17:15:01 -0400
commiteefea5676b93876b40c02ff1d29d7404703c6fea (patch)
tree41b7bdeab2f1cdece836d21775277834867c5814 /jstests/concurrency
parent80820aa72be8d244a87b30d3ebceb341aa888b0c (diff)
downloadmongo-eefea5676b93876b40c02ff1d29d7404703c6fea.tar.gz
SERVER-39992 Add version of concurrency_sharded_multi_stmt_txn.yml with stepdowns
Diffstat (limited to 'jstests/concurrency')
-rw-r--r--jstests/concurrency/fsm_workload_helpers/server_types.js5
-rw-r--r--jstests/concurrency/fsm_workloads/yield.js13
2 files changed, 14 insertions, 4 deletions
diff --git a/jstests/concurrency/fsm_workload_helpers/server_types.js b/jstests/concurrency/fsm_workload_helpers/server_types.js
index a90cc9c751f..1207d43e9de 100644
--- a/jstests/concurrency/fsm_workload_helpers/server_types.js
+++ b/jstests/concurrency/fsm_workload_helpers/server_types.js
@@ -5,9 +5,8 @@
*
*/
function isMongos(db) {
- var res = db.runCommand('ismaster');
- assert.commandWorked(res);
-
+ // Run isMaster directly on the database's session's client to bypass any session machinery.
+ const res = assert.commandWorked(db.getSession().getClient().adminCommand('ismaster'));
return 'isdbgrid' === res.msg;
}
diff --git a/jstests/concurrency/fsm_workloads/yield.js b/jstests/concurrency/fsm_workloads/yield.js
index 5b9015fab0a..5aaf9f086e7 100644
--- a/jstests/concurrency/fsm_workloads/yield.js
+++ b/jstests/concurrency/fsm_workloads/yield.js
@@ -8,6 +8,15 @@
*/
var $config = (function() {
+ // The explain used to build the assertion message in advanceCursor() is the only command not
+ // allowed in a transaction used in the query state function. With shard stepdowns, getMores
+ // aren't allowed outside a transaction, so if the explain runs when the suite is configured to
+ // run with transactions and shard stepdowns, the query state function will be retried outside a
+ // transaction, which fails the test. This can be avoided by not running explain with this
+ // configuration.
+ const skipExplainInErrorMessage =
+ TestData.runInsideTransaction && TestData.runningWithShardStepdowns;
+
var data = {
// Number of docs to insert at the beginning.
nDocs: 200,
@@ -29,7 +38,9 @@ var $config = (function() {
doc = cursor.next();
assertAlways(verifier(doc, prevDoc),
'Verifier failed!\nQuery: ' + tojson(cursor._query) + '\n' +
- 'Query plan: ' + tojson(cursor.explain()) + '\n' +
+ (skipExplainInErrorMessage ? '' : 'Query plan: ' +
+ tojson(cursor.explain())) +
+ '\n' +
'Previous doc: ' + tojson(prevDoc) + '\n' +
'This doc: ' + tojson(doc));
}