Skip to content

Fix exception message expectation on MongoDB latest #1637

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 1 commit into from
Sep 9, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Sep 9, 2024

On MongoDB latest, the error message is different as the validation is handled by the execution planner. The additional %S ensures that tests pass on upcoming versions of MongoDB as well.

@alcaeus alcaeus requested a review from GromNaN September 9, 2024 09:08
@alcaeus alcaeus self-assigned this Sep 9, 2024
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

What is the message in the new version?

@alcaeus
Copy link
Member Author

alcaeus commented Sep 9, 2024

The full error is:

Plan executor error during update :: caused by :: Document failed validation

Using %S we can still assert that the BulkWriteException was caused by a document validation failure, instead of having to remove the exception message entirely and only checking for a write exception that could be caused by multiple other things.

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

LGTM

@alcaeus alcaeus merged commit ded0456 into mongodb:v1.20 Sep 9, 2024
81 checks passed
@alcaeus alcaeus deleted the fix-latest-tests branch September 9, 2024 11:04
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