Skip to content

test(DRIVERS-3034): remove/update 4.0 related tests #1796

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 3 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 1 addition & 11 deletions source/change-streams/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,13 @@ and sharded clusters unless otherwise specified:

11. For a `ChangeStream` under these conditions:

- Running against a server `>=4.0.7`.
- The batch is empty or has been iterated to the last document.

Expected result:

- `getResumeToken` must return the `postBatchResumeToken` from the current command response.

12. For a `ChangeStream` under these conditions:

- Running against a server `<4.0.7`.
- The batch is empty or has been iterated to the last document.

Expected result:

- `getResumeToken` must return the `_id` of the last document returned if one exists.
- `getResumeToken` must return `resumeAfter` from the initial aggregate if the option was specified.
- If `resumeAfter` was not specified, the `getResumeToken` result must be empty.
12. **Removed**

13. For a `ChangeStream` under these conditions:

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ phases: [
setVersion: 1,
setName: "rs",
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
Copy link
Member Author

Choose a reason for hiding this comment

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

Wire version 16 is server 5.3

Copy link
Contributor

Choose a reason for hiding this comment

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

The Java and C drivers are able to pass these tests still, I think because it's only in server selection where the maxWireVersion is checked. Do you expect other drivers to fail these tests, and if so, what causes the failure?

Copy link
Member Author

@durran durran May 6, 2025

Choose a reason for hiding this comment

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

My expectation is that no drivers would fail these tests currently as they are for pre 6.0 and this sets the max wire version for 5.3. If the drivers remove support for 4.0, I expect these tests to fail without this change on drivers that do wire version checks outside of server selection as the maxWireVersion would then be lower than the minWireVersion. (For example, Node does do this check outside of server selection in https://github.com/mongodb/node-mongodb-native/blob/fcbc6edfc3d54f5dbd3b142c06ef205ecd2729b8/src/cmap/connect.ts#L60)

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, this seems like a harmless change to make, even for drivers using submodules. There is no loss of test coverage, and the tests should pass all drivers.

But why stop at 5.3? Any reason not to just bump it up the MongoDB 8.0 wire version?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, as you explained in Slack, this is for pre-6.0

}]
],

Expand Down Expand Up @@ -57,7 +57,7 @@ phases: [
setVersion: 1,
electionId: {"$oid": "000000000000000000000002"},
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
}]
],

Expand Down Expand Up @@ -99,7 +99,7 @@ phases: [
setVersion: 1,
setName: "rs",
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
}]
],
outcome: {
Expand Down Expand Up @@ -142,7 +142,7 @@ phases: [
setVersion: 1,
electionId: {"$oid": "000000000000000000000001"},
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
}]
],
outcome: {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ phases: [
# servers from a primary isWritablePrimary are added to the working server set
me: "a:27017",
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 25
Copy link
Member Author

Choose a reason for hiding this comment

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

These I just updated to latest to not need to continually update them.

}]
],
outcome: {
Expand Down Expand Up @@ -53,7 +53,7 @@ phases: [
primary: "localhost:27017",
me: "localhost:27018",
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 25
}]
],
outcome: {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ phases: [
setName: "rs",
setVersion: 2,
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
}]
],

Expand Down Expand Up @@ -52,7 +52,7 @@ phases: [
setName: "rs",
setVersion: 1,
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
}]
],

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ phases: [
setVersion: 1,
electionId: {"$oid": "000000000000000000000001"},
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
}]
],

Expand Down Expand Up @@ -53,7 +53,7 @@ phases: [
setName: "rs",
setVersion: 2,
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
}]
],

Expand Down Expand Up @@ -92,7 +92,7 @@ phases: [
setVersion: 1,
electionId: {"$oid": "000000000000000000000002"},
minWireVersion: 0,
maxWireVersion: 7
maxWireVersion: 16
}]
],
outcome: {
Expand Down
Loading