Skip to content

PYTHON-3652 Bump maxWireVersion for MongoDB 7.0 #1188

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
Apr 12, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pymongo/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# What this version of PyMongo supports.
MIN_SUPPORTED_SERVER_VERSION = "3.6"
MIN_SUPPORTED_WIRE_VERSION = 6
MAX_SUPPORTED_WIRE_VERSION = 17
MAX_SUPPORTED_WIRE_VERSION = 21

# Frequency to call hello on servers, in seconds.
HEARTBEAT_FREQUENCY = 10
Expand Down
9 changes: 5 additions & 4 deletions test/test_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ def test_wire_version(self):
t.select_servers(any_server_selector)

# Incompatible.
max_version = common.MAX_SUPPORTED_WIRE_VERSION
got_hello(
t,
address,
Expand All @@ -540,8 +541,8 @@ def test_wire_version(self):
HelloCompat.LEGACY_CMD: True,
"setName": "rs",
"hosts": ["a"],
"minWireVersion": 21,
"maxWireVersion": 22,
"minWireVersion": max_version + 1,
"maxWireVersion": max_version + 2,
Copy link
Member

Choose a reason for hiding this comment

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

I understand your motivation here but I think it's good to keep this test separate from common.MAX_SUPPORTED_WIRE_VERSION, that way when we change MAX_SUPPORTED_WIRE_VERSION we know it has an effect.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

},
)

Expand All @@ -551,8 +552,8 @@ def test_wire_version(self):
# Error message should say which server failed and why.
self.assertEqual(
str(e),
"Server at a:27017 requires wire version 21, but this version "
"of PyMongo only supports up to %d." % (common.MAX_SUPPORTED_WIRE_VERSION,),
"Server at a:27017 requires wire version %d, but this version "
"of PyMongo only supports up to %d." % (max_version + 1, max_version),
)
else:
self.fail("No error with incompatible wire version")
Expand Down