Skip to content

Commit 84d2354

Browse files
committed
test: temporarily skip sharded transactions tests
1 parent 0b6f813 commit 84d2354

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

test/functional/spec-runner/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,16 @@ function generateTopologyTests(testSuites, testContext, filter) {
123123
afterEach(() => testContext.cleanupAfterSuite());
124124

125125
testSuite.tests.forEach(spec => {
126-
const maybeSkipIt =
127-
spec.skipReason || (filter && typeof filter === 'function' && !filter(spec))
128-
? it.skip
129-
: it;
126+
it(spec.description, function() {
127+
if (
128+
spec.skipReason ||
129+
(filter && typeof filter === 'function' && !filter(spec, this.configuration))
130+
) {
131+
this.skip();
132+
return;
133+
}
130134

131-
maybeSkipIt(spec.description, function() {
132135
let testPromise = Promise.resolve();
133-
134136
if (spec.failPoint) {
135137
testPromise = testPromise.then(() => testContext.enableFailPoint(spec.failPoint));
136138
}

test/functional/transactions.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const TestRunnerContext = require('./spec-runner').TestRunnerContext;
88
const loadSpecTests = require('../spec').loadSpecTests;
99
const generateTopologyTests = require('./spec-runner').generateTopologyTests;
1010
const MongoNetworkError = require('../../lib/core').MongoNetworkError;
11+
const semver = require('semver');
1112

1213
describe('Transactions', function() {
1314
const testContext = new TestRunnerContext();
@@ -26,7 +27,12 @@ describe('Transactions', function() {
2627
return testContext.setup(this.configuration);
2728
});
2829

29-
function testFilter(spec) {
30+
function testFilter(spec, config) {
31+
// NODE-2574: remove this when HELP-15010 is resolved
32+
if (config.topologyType === 'Sharded' && semver.satisfies(config.version, '>=4.4')) {
33+
return false;
34+
}
35+
3036
const SKIP_TESTS = [
3137
// commitTransaction retry seems to be swallowed by mongos in these three cases
3238
'commitTransaction retry succeeds on new mongos',

test/tools/runner/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const core = require('../../../lib/core');
1010
class NativeConfiguration {
1111
constructor(parsedURI, context) {
1212
this.topologyType = context.topologyType;
13+
this.version = context.version;
1314
this.clientSideEncryption = context.clientSideEncryption;
1415
this.options = Object.assign(
1516
{

0 commit comments

Comments
 (0)