Skip to content

Commit f468ae4

Browse files
skip outdated tests
1 parent dcef868 commit f468ae4

File tree

1 file changed

+34
-8
lines changed

1 file changed

+34
-8
lines changed

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

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,22 @@ describe('Legacy Retryable Writes Specs', function () {
1919

2020
const retryableWrites = loadSpecTests('retryable-writes', 'legacy');
2121

22+
const LEGACY_SKIP_TESTS_4_4_SHARDED = [
23+
'BulkWrite succeeds after WriteConcernError ShutdownInProgress',
24+
'DeleteOne succeeds after WriteConcernError ShutdownInProgress',
25+
'FindOneAndDelete succeeds after WriteConcernError ShutdownInProgress',
26+
'FindOneAndReplace succeeds after WriteConcernError ShutdownInProgress',
27+
'FindOneAndUpdate succeeds after WriteConcernError ShutdownInProgress',
28+
'InsertMany succeeds after WriteConcernError ShutdownInProgress',
29+
'InsertOne succeeds after WriteConcernError InterruptedAtShutdown',
30+
'InsertOne succeeds after WriteConcernError InterruptedDueToReplStateChange',
31+
'InsertOne succeeds after WriteConcernError PrimarySteppedDown',
32+
'InsertOne succeeds after WriteConcernError ShutdownInProgress',
33+
'InsertOne fails after multiple retryable writeConcernErrors',
34+
'ReplaceOne succeeds after WriteConcernError ShutdownInProgress',
35+
'UpdateOne succeeds after WriteConcernError ShutdownInProgress'
36+
];
37+
2238
for (const suite of retryableWrites) {
2339
describe(suite.name, function () {
2440
beforeEach(async function () {
@@ -65,14 +81,24 @@ describe('Legacy Retryable Writes Specs', function () {
6581
});
6682

6783
for (const spec of suite.tests) {
68-
// Step 2: Run the test
69-
const mochaTest = it(spec.description, async () => await executeScenarioTest(spec, ctx));
70-
71-
// A pattern we don't need to repeat for unified tests
72-
// In order to give the beforeEach hook access to the
73-
// spec test so it can be responsible for skipping it
74-
// and executeScenarioSetup
75-
mochaTest.spec = spec;
84+
if (
85+
LEGACY_SKIP_TESTS_4_4_SHARDED.includes(spec.description) &&
86+
this.ctx.topologyType === 'Sharded' &&
87+
Number(this.ctx.version) <= 4.4
88+
) {
89+
this.ctx.skipReason =
90+
'drivers should not consider the code within the writeConcernError field from a pre-4.4 mongos response';
91+
this.ctx.skip();
92+
} else {
93+
// Step 2: Run the test
94+
const mochaTest = it(spec.description, async () => await executeScenarioTest(spec, ctx));
95+
96+
// A pattern we don't need to repeat for unified tests
97+
// In order to give the beforeEach hook access to the
98+
// spec test so it can be responsible for skipping it
99+
// and executeScenarioSetup
100+
mochaTest.spec = spec;
101+
}
76102
}
77103
});
78104
}

0 commit comments

Comments
 (0)