Skip to content

Commit 0620ec0

Browse files
committed
test(NODE-3711): unskip transaction retry spec tests
1 parent ac44599 commit 0620ec0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/sessions.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
MongoError,
99
MongoInvalidArgumentError,
1010
isRetryableError,
11+
isRetryableWriteError,
1112
MongoCompatibilityError,
1213
MongoNetworkError,
1314
MongoWriteConcernError,
@@ -767,7 +768,11 @@ function endTransaction(session: ClientSession, commandName: string, callback: C
767768
session.unpin();
768769
}
769770

770-
if (err && isRetryableError(err as MongoError)) {
771+
/* eslint no-console: 0 */
772+
console.log('\n\n\nerr', err);
773+
if (err && isRetryableWriteError(err as MongoError)) {
774+
/* eslint no-console: 0 */
775+
console.log('retrying');
771776
// SPEC-1185: apply majority write concern when retrying commitTransaction
772777
if (command.commitTransaction) {
773778
// per txns spec, must unpin session in this case

test/functional/transactions.test.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,10 @@ const SKIP_TESTS = [
111111

112112
// Will be implemented as part of NODE-2034
113113
'Client side error in command starting transaction',
114-
'Client side error when transaction is in progress',
115-
116-
// Will be implemented as part of NODE-2538
117-
'abortTransaction only retries once with RetryableWriteError from server',
118-
'abortTransaction does not retry without RetryableWriteError label',
119-
'commitTransaction does not retry error without RetryableWriteError label',
120-
'commitTransaction retries once with RetryableWriteError from server'
114+
'Client side error when transaction is in progress'
121115
];
122116

123-
describe('Transactions Spec Legacy Tests', function () {
117+
describe.only('Transactions Spec Legacy Tests', function () {
124118
const testContext = new TransactionsRunnerContext();
125119
const suitesToRun = [{ name: 'spec tests', specPath: path.join('transactions', 'legacy') }];
126120
// Note: convenient-api tests are skipped for serverless

0 commit comments

Comments
 (0)