Skip to content

Commit c6ac32c

Browse files
test(NODE-5852): skip transaction unpin spec tests on latest (#3980)
1 parent a42039b commit c6ac32c

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Diff for: test/integration/transactions/transactions.spec.test.js

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
import { gte } from 'semver';
4+
35
const path = require('path');
46
const { expect } = require('chai');
57
const { TestRunnerContext, generateTopologyTests } = require('../../tools/spec-runner');
@@ -78,11 +80,25 @@ class TransactionsRunnerContext extends TestRunnerContext {
7880
}
7981
}
8082

83+
const LATEST_UNIFIED_SKIP_TESTS = [
84+
'unpin after TransientTransactionError error on commit',
85+
'unpin on successful abort',
86+
'unpin after non-transient error on abort',
87+
'unpin after TransientTransactionError error on abort',
88+
'unpin when a new transaction is started',
89+
'unpin when a non-transaction write operation uses a session',
90+
'unpin when a non-transaction read operation uses a session'
91+
];
92+
8193
describe('Transactions Spec Unified Tests', function () {
82-
runUnifiedSuite(loadSpecTests(path.join('transactions', 'unified')));
94+
runUnifiedSuite(loadSpecTests(path.join('transactions', 'unified')), (test, ctx) =>
95+
gte(ctx.version, '8.0.0') && LATEST_UNIFIED_SKIP_TESTS.includes(test.description)
96+
? 'TODO(NODE-5855): Unskip Transactions Spec Unified Tests mongos-unpin.unpin'
97+
: false
98+
);
8399
});
84100

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

116132
function testFilter(spec) {
117-
return SKIP_TESTS.indexOf(spec.description) === -1;
133+
return LEGACY_SKIP_TESTS.indexOf(spec.description) === -1;
118134
}
119135

120136
generateTopologyTests(testSuites, testContext, testFilter);

0 commit comments

Comments
 (0)