Skip to content

DRIVERS-2975 Fix logic for populating BulkWriteException.partialResult #1665

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 8 commits into from
Sep 25, 2024

Conversation

isabelatkinson
Copy link
Contributor

Please complete the following before merging:

  • Update changelog.
  • Make sure there are generated JSON files from the YAML test files.
  • Test changes in at least one language driver.
  • Test these changes against all server versions and topologies (including standalone, replica set, sharded
    clusters, and serverless).

@isabelatkinson isabelatkinson changed the title Partial result DRIVERS-2975 Fix logic for populating BulkWriteException.partialResult Sep 23, 2024
@isabelatkinson
Copy link
Contributor Author

newDocument: &newDocument { _id: 2, x: 22 }

tests:
- description: "partialResult is unset when first operation fails during an ordered bulk write (verbose)"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verbose and summary are both tested here to make sure that drivers aren't determining the index of the write error by its position in the cursor rather than the idx field. The type of result is not relevant for the unordered logic, so I skipped testing both for the equivalent unordered test.

document: *newDocument
ordered: true
verboseResults: true
expectError:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other pieces of BulkWriteException are tested elsewhere, so I skipped including them here.

@isabelatkinson isabelatkinson marked this pull request as ready for review September 23, 2024 21:39
@isabelatkinson isabelatkinson requested a review from a team as a code owner September 23, 2024 21:39
@isabelatkinson isabelatkinson requested review from nbbeeken, kevinAlbs and stIncMale and removed request for a team and nbbeeken September 23, 2024 21:39
Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM with a suggested change to test assertions. With suggested changes, verified tests pass in C driver locally.

Copy link
Contributor

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM with additional { $$exists: false }.

@isabelatkinson isabelatkinson merged commit dc14887 into mongodb:master Sep 25, 2024
4 checks passed
isabelatkinson added a commit to isabelatkinson/specifications that referenced this pull request Sep 25, 2024
insertedId: 2
updateResults: {}
deleteResults: {}
- description: "partialResult is set when first operation fails during an unordered bulk write (summary)"
Copy link
Member

Choose a reason for hiding this comment

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

@isabelatkinson: FYI, this is a duplicate test name (also used earlier on line 183). Assuming that was unintentional, what should this test actually be called?

Asking as this came up in mongodb/mongo-php-library#1429 /cc @alcaeus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

bad copy/paste, fixed here

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.

4 participants