-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
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") |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
Opened https://jira.mongodb.org/browse/PYTHON-3188 for the encryption failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
https://jira.mongodb.org/browse/PYTHON-3160