Skip to content

Commit

Permalink
test(NODE-5852): skip transaction unpin spec tests on latest (#3980)
Browse files Browse the repository at this point in the history
  • Loading branch information
aditi-khare-mongoDB authored Feb 1, 2024
1 parent a42039b commit c6ac32c
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions test/integration/transactions/transactions.spec.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

import { gte } from 'semver';

const path = require('path');
const { expect } = require('chai');
const { TestRunnerContext, generateTopologyTests } = require('../../tools/spec-runner');
Expand Down Expand Up @@ -78,11 +80,25 @@ class TransactionsRunnerContext extends TestRunnerContext {
}
}

const LATEST_UNIFIED_SKIP_TESTS = [
'unpin after TransientTransactionError error on commit',
'unpin on successful abort',
'unpin after non-transient error on abort',
'unpin after TransientTransactionError error on abort',
'unpin when a new transaction is started',
'unpin when a non-transaction write operation uses a session',
'unpin when a non-transaction read operation uses a session'
];

describe('Transactions Spec Unified Tests', function () {
runUnifiedSuite(loadSpecTests(path.join('transactions', 'unified')));
runUnifiedSuite(loadSpecTests(path.join('transactions', 'unified')), (test, ctx) =>
gte(ctx.version, '8.0.0') && LATEST_UNIFIED_SKIP_TESTS.includes(test.description)
? 'TODO(NODE-5855): Unskip Transactions Spec Unified Tests mongos-unpin.unpin'
: false
);
});

const SKIP_TESTS = [
const LEGACY_SKIP_TESTS = [
// TODO(NODE-3943): Investigate these commit test failures
// OLD COMMENT: commitTransaction retry seems to be swallowed by mongos in these two cases
'commitTransaction retry fails on new mongos',
Expand All @@ -97,7 +113,7 @@ describe('Transactions Spec Legacy Tests', function () {
const testContext = new TransactionsRunnerContext();
if (process.env.SERVERLESS) {
// TODO(NODE-3550): these tests should pass on serverless but currently fail
SKIP_TESTS.push(
LEGACY_SKIP_TESTS.push(
'abortTransaction only performs a single retry',
'abortTransaction does not retry after Interrupted',
'abortTransaction does not retry after WriteConcernError Interrupted',
Expand All @@ -114,7 +130,7 @@ describe('Transactions Spec Legacy Tests', function () {
});

function testFilter(spec) {
return SKIP_TESTS.indexOf(spec.description) === -1;
return LEGACY_SKIP_TESTS.indexOf(spec.description) === -1;
}

generateTopologyTests(testSuites, testContext, testFilter);
Expand Down

0 comments on commit c6ac32c

Please sign in to comment.