Skip to content

Commit da92699

Browse files
ready for rereview
1 parent 231fb80 commit da92699

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/integration/retryable-writes/retryable_writes.spec.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { expect } from 'chai';
22
import * as path from 'path';
3+
import { lt } from 'semver';
34

45
import type { Collection, Db, MongoClient } from '../../mongodb';
56
import { loadSpecTests } from '../../spec';
@@ -37,6 +38,8 @@ describe('Legacy Retryable Writes Specs', function () {
3738

3839
for (const suite of retryableWrites) {
3940
describe(suite.name, function () {
41+
let isShardedAndBefore4_4 = false;
42+
4043
beforeEach(async function () {
4144
let utilClient: MongoClient;
4245
if (this.configuration.isLoadBalanced) {
@@ -54,6 +57,9 @@ describe('Legacy Retryable Writes Specs', function () {
5457
!allRequirements.length ||
5558
(await isAnyRequirementSatisfied(this.currentTest.ctx, allRequirements, utilClient));
5659

60+
isShardedAndBefore4_4 =
61+
this.configuration.topologyType === 'Sharded' && lt(this.configuration.version, '4.4.0');
62+
5763
await utilClient.close();
5864

5965
if (!someRequirementMet) this.skip();
@@ -80,7 +86,7 @@ describe('Legacy Retryable Writes Specs', function () {
8086
ctx = {}; // reset context
8187
});
8288
for (const spec of suite.tests) {
83-
if (!LEGACY_SKIP_TESTS_4_4_SHARDED.includes(spec.description)) {
89+
if (!LEGACY_SKIP_TESTS_4_4_SHARDED.includes(spec.description) && !isShardedAndBefore4_4) {
8490
// Step 2: Run the test
8591
const mochaTest = it(spec.description, async () => await executeScenarioTest(spec, ctx));
8692

0 commit comments

Comments
 (0)