Skip to content

PYTHON-3160 Fix MMAPv1 tests #914

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 2 commits into from
Mar 31, 2022
Merged

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Mar 30, 2022

self.skipTest("MMAPv1 does not support document-level locking")
if not client_context.test_commands_enabled:
if name == "failPoint" or name == "targetedFailPoint":
self.skipTest("Test commands must be enabled to use fail points")
Copy link
Member Author

@ShaneHarvey ShaneHarvey Mar 30, 2022

Choose a reason for hiding this comment

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

The explanation here is that we're trying to skip createChangeStream tests on mmapv1 at run time which would cause problems when the test used both createChangeStream and expectError. The new code checks if we should skip the test before executing it. This also speeds up the test suite a bit since we don't have to run half of a bunch of tests just to find out we can skip them.

for i in listener.results["started"]:
if i.command.get("lsid"):
lsid_set.add(i.command.get("lsid")["id"])
if len(lsid_set) == 1:
succeeded = True
else:
failures += 1
print(failures)
self.assertTrue(succeeded)
self.assertTrue(succeeded, lsid_set)
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a small improvement to include the last lsid_set in the error output when the test fails.

client = rs_or_single_client(
event_listeners=[listener], maxPoolSize=1, retryWrites=True
)
client = rs_or_single_client(event_listeners=[listener], maxPoolSize=1)
Copy link
Member Author

Choose a reason for hiding this comment

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

This test doesn't need retryWrite=True (which doesn't work on MMAPv1).

@@ -448,7 +448,6 @@
"name": "insertOne",
"object": "collection0",
"arguments": {
"session": "session0",
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bug fix in the spec test that I will upstream.

@ShaneHarvey
Copy link
Member Author

Opened https://jira.mongodb.org/browse/PYTHON-3188 for the encryption failures.

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ShaneHarvey ShaneHarvey merged commit 484058e into mongodb:master Mar 31, 2022
@ShaneHarvey ShaneHarvey deleted the PYTHON-3160 branch March 31, 2022 05:10
juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants