Skip to content

test(NODE-5852): Skip transaction unpin spec tests #3980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 1, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 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 @@ -93,6 +95,14 @@ const SKIP_TESTS = [
'Client side error when transaction is in progress'
];

const LATEST_SKIP_TESTS = [
// TODO(NODE-5855): Unskip Transactions Spec Unified Tests mongos-unpin.unpin
'unpin after TransientTransactionError error on commit',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed only skipping on latest, which is a smoke test anyway, these tests still pass for servers that are used in production, we can continue to make sure these work on those servers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder, I've changed it to skipped on latest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant I skipped it within the code.

'unpin on successful abort',
'unpin after non-transient error on abort',
'unpin after TransientTransactionError error on abort'
];

describe('Transactions Spec Legacy Tests', function () {
const testContext = new TransactionsRunnerContext();
if (process.env.SERVERLESS) {
Expand All @@ -113,8 +123,11 @@ describe('Transactions Spec Legacy Tests', function () {
return testContext.setup(this.configuration);
});

function testFilter(spec) {
return SKIP_TESTS.indexOf(spec.description) === -1;
function testFilter(spec, configuration) {
return (
SKIP_TESTS.indexOf(spec.description) === -1 &&
(!gte(configuration.version, '7.1.0') || LATEST_SKIP_TESTS.indexOf(spec.description) === -1)
);
}

generateTopologyTests(testSuites, testContext, testFilter);
Expand Down