diff --git a/test/integration/transactions/transactions.spec.test.js b/test/integration/transactions/transactions.spec.test.js index 05b829324a..d1fe27ef78 100644 --- a/test/integration/transactions/transactions.spec.test.js +++ b/test/integration/transactions/transactions.spec.test.js @@ -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'); @@ -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', @@ -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', @@ -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);