summaryrefslogtreecommitdiff
path: root/jstests/sharding/transactions_targeting_errors.js
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2019-05-29 11:56:00 -0400
committerLingzhi Deng <lingzhi.deng@mongodb.com>2019-06-01 21:10:35 -0400
commitc9fa616db03de737c44340f33a44863072a0955d (patch)
treeb50f1d130f573108bc89f7f67fb391068c4b1f3e /jstests/sharding/transactions_targeting_errors.js
parent9fd2778ec5f438d4351ef11143e3158161fcb830 (diff)
downloadmongo-c9fa616db03de737c44340f33a44863072a0955d.tar.gz
SERVER-40386: assert responses of abortTransaction_forTesting() and commitTransaction_forTesting()
Diffstat (limited to 'jstests/sharding/transactions_targeting_errors.js')
-rw-r--r--jstests/sharding/transactions_targeting_errors.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/sharding/transactions_targeting_errors.js b/jstests/sharding/transactions_targeting_errors.js
index 2102977792e..9f490994c88 100644
--- a/jstests/sharding/transactions_targeting_errors.js
+++ b/jstests/sharding/transactions_targeting_errors.js
@@ -24,7 +24,8 @@
assert.commandFailedWithCode(res, ErrorCodes.InvalidOptions);
assert(res.hasOwnProperty("writeErrors"), "expected write errors, res: " + tojson(res));
- session.abortTransaction_forTesting();
+ assert.commandFailedWithCode(session.abortTransaction_forTesting(),
+ ErrorCodes.NoSuchTransaction);
// Failed delete.
@@ -34,7 +35,8 @@
assert.commandFailedWithCode(res, ErrorCodes.ShardKeyNotFound);
assert(res.hasOwnProperty("writeErrors"), "expected write errors, res: " + tojson(res));
- session.abortTransaction_forTesting();
+ assert.commandFailedWithCode(session.abortTransaction_forTesting(),
+ ErrorCodes.NoSuchTransaction);
st.stop();
}());