1
1
'use strict' ;
2
2
3
+ import { gte } from 'semver' ;
4
+
3
5
const path = require ( 'path' ) ;
4
6
const { expect } = require ( 'chai' ) ;
5
7
const { TestRunnerContext, generateTopologyTests } = require ( '../../tools/spec-runner' ) ;
@@ -78,11 +80,25 @@ class TransactionsRunnerContext extends TestRunnerContext {
78
80
}
79
81
}
80
82
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
+
81
93
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
+ ) ;
83
99
} ) ;
84
100
85
- const SKIP_TESTS = [
101
+ const LEGACY_SKIP_TESTS = [
86
102
// TODO(NODE-3943): Investigate these commit test failures
87
103
// OLD COMMENT: commitTransaction retry seems to be swallowed by mongos in these two cases
88
104
'commitTransaction retry fails on new mongos' ,
@@ -97,7 +113,7 @@ describe('Transactions Spec Legacy Tests', function () {
97
113
const testContext = new TransactionsRunnerContext ( ) ;
98
114
if ( process . env . SERVERLESS ) {
99
115
// TODO(NODE-3550): these tests should pass on serverless but currently fail
100
- SKIP_TESTS . push (
116
+ LEGACY_SKIP_TESTS . push (
101
117
'abortTransaction only performs a single retry' ,
102
118
'abortTransaction does not retry after Interrupted' ,
103
119
'abortTransaction does not retry after WriteConcernError Interrupted' ,
@@ -114,7 +130,7 @@ describe('Transactions Spec Legacy Tests', function () {
114
130
} ) ;
115
131
116
132
function testFilter ( spec ) {
117
- return SKIP_TESTS . indexOf ( spec . description ) === - 1 ;
133
+ return LEGACY_SKIP_TESTS . indexOf ( spec . description ) === - 1 ;
118
134
}
119
135
120
136
generateTopologyTests ( testSuites , testContext , testFilter ) ;
0 commit comments