Skip to content

Conversation

@blink1073
Copy link
Member

No description provided.

@blink1073
Copy link
Member Author

Docs failure is unrelated, https://wiki.centos.org/AdditionalResources/Repositories/SCL was also erroring out temporarily last week.

@blink1073
Copy link
Member Author

RedHat wiki is back up, I kicked the link check job.

raise
else:
if expect_error:
if expect_error and opname != "iterateUntilDocumentOrError":
Copy link
Member

Choose a reason for hiding this comment

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

What is the iterateUntilDocumentOrError check for?

Copy link
Member Author

Choose a reason for hiding this comment

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

For the case where this an "expectError", but the error condition isn't raised, because we got a document instead, which as I understand it is what iterateUntilDocumentOrError implies.

Copy link
Member

Choose a reason for hiding this comment

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

It looks like iterateUntilDocumentOrError is usually (always?) accompanied by "expectError" or "expectResult". When expectError is there but the iterateUntilDocumentOrError op does not error, shouldn't we still fail the test?

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the modification based on feedback about how "expectError" should be handled in the spec: "If operation.expectError is specified, the test runner MUST assert that the operation yielded an error; otherwise, the test runner MUST assert that the operation did not yield an error.

I suspect this will make "test_change_stream.TestUnifiedChangeStreamsErrors.test_change_stream_errors_on_ElectionInProgress" fail again on Server 4.2, let's find out.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure enough:

AssertionError: Excepted error {'errorCode': 216} but "iterateUntilDocumentOrError" succeeded: 
{'_id':
 {'_data': '82628D50B2000000042B022C0100296E5A10044BBFDAAD009A4B0A8CF9E843E82603C946645F69640064628D50B26500615C7FE84A840004'},
 'operationType': 'insert', 'clusterTime': Timestamp(1653428402, 4), 'fullDocument':
 {'_id': ObjectId('628d50b26500615c7fe84a84'), 'z': 3}, 'ns': {'db': 'database0', 'coll': 'collection0'},
 'documentKey': {'_id': ObjectId('628d50b26500615c7fe84a84')}}

Copy link
Member

Choose a reason for hiding this comment

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

This looks like the last issue to resolve. Are you saying this is a bug in the spec test itself? How about we add back the and opname != "iterateUntilDocumentOrError": behavior until the test is fixed so that we can merge this PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it is a spec test failure, given that several other drivers have implemented the unified spec change.

Copy link
Member

Choose a reason for hiding this comment

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

How should we proceed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do some testing with server 4.2 to see if I can spot a bug in our driver.

@blink1073 blink1073 marked this pull request as draft May 20, 2022 22:23
@blink1073
Copy link
Member Author

Moving to draft to make sure we handle PYTHON-3273 and PYTHON-3237.

@blink1073 blink1073 marked this pull request as ready for review May 23, 2022 15:16
@blink1073 blink1073 requested a review from ShaneHarvey May 23, 2022 15:17
raise
else:
if expect_error:
if expect_error and opname != "iterateUntilDocumentOrError":
Copy link
Member

Choose a reason for hiding this comment

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

It looks like iterateUntilDocumentOrError is usually (always?) accompanied by "expectError" or "expectResult". When expectError is there but the iterateUntilDocumentOrError op does not error, shouldn't we still fail the test?

continue

self.assertGreaterEqual(len(actual_events), len(events), actual_events)
self.assertEqual(len(actual_events), len(events), actual_events)
Copy link
Member

Choose a reason for hiding this comment

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

Oh I see. So we always had the ignoreExtraEvents=True behavior before this.

@blink1073
Copy link
Member Author

Opend https://jira.mongodb.org/browse/PYTHON-3292 to track the removal of the workaround for the failing test.

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

LGTM once the tests pass.

@blink1073 blink1073 merged commit 62a6302 into mongodb:master Jun 1, 2022
@blink1073 blink1073 deleted the PYTHON-2683 branch June 1, 2022 23:26
juliusgeo pushed a commit to juliusgeo/mongo-python-driver that referenced this pull request Jun 29, 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