Skip to content

Commit

Permalink
test(NODE-3711): unskip transaction retry spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Nov 18, 2021
1 parent ac44599 commit 0620ec0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 6 additions & 1 deletion src/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
MongoError,
MongoInvalidArgumentError,
isRetryableError,
isRetryableWriteError,
MongoCompatibilityError,
MongoNetworkError,
MongoWriteConcernError,
Expand Down Expand Up @@ -767,7 +768,11 @@ function endTransaction(session: ClientSession, commandName: string, callback: C
session.unpin();
}

if (err && isRetryableError(err as MongoError)) {
/* eslint no-console: 0 */
console.log('\n\n\nerr', err);
if (err && isRetryableWriteError(err as MongoError)) {
/* eslint no-console: 0 */
console.log('retrying');
// SPEC-1185: apply majority write concern when retrying commitTransaction
if (command.commitTransaction) {
// per txns spec, must unpin session in this case
Expand Down
10 changes: 2 additions & 8 deletions test/functional/transactions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,10 @@ const SKIP_TESTS = [

// Will be implemented as part of NODE-2034
'Client side error in command starting transaction',
'Client side error when transaction is in progress',

// Will be implemented as part of NODE-2538
'abortTransaction only retries once with RetryableWriteError from server',
'abortTransaction does not retry without RetryableWriteError label',
'commitTransaction does not retry error without RetryableWriteError label',
'commitTransaction retries once with RetryableWriteError from server'
'Client side error when transaction is in progress'
];

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

0 comments on commit 0620ec0

Please sign in to comment.