Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The unified runner mishandles wrapped encryption errors and ignores writeConcernErrors assertions, causing one test to fail incorrectly and another to pass without verifying error code 79.
2 open issues
What changed in this PR
Syncs write concern error specification tests into PyMongo’s synchronous and asynchronous test suites, without changing driver functionality.
Changes:
- Adds specification cases covering write concern error reporting across CRUD, bulk writes, management operations, GridFS, and encryption.
- Registers the new cases with the unified test runner, marking unsupported MapReduce cases as expected failures.
- Updates the spec-sync script to import the new test directory.
| File | Description |
|---|---|
test/test_read_write_concern_spec.py |
Registers the new synchronous unified tests. |
test/read_write_concern/write-concern-errors/mapReduce.json |
Adds a MapReduce write concern error case. |
test/read_write_concern/write-concern-errors/index-management.json |
Covers index creation and deletion errors. |
test/read_write_concern/write-concern-errors/gridfs.json |
Covers upload, deletion, and rename errors. |
test/read_write_concern/write-concern-errors/findAndModify.json |
Covers find-and-modify write concern errors. |
test/read_write_concern/write-concern-errors/db-coll-management.json |
Covers database and collection management errors. |
test/read_write_concern/write-concern-errors/crud.json |
Covers insert, update, replace, and delete errors. |
test/read_write_concern/write-concern-errors/client-side-encryption.json |
Covers encryption key-management write concern errors. |
test/read_write_concern/write-concern-errors/client-bulkWrite.json |
Adds a client bulk-write error assertion. |
test/read_write_concern/write-concern-errors/bulkWrite.json |
Adds a collection bulk-write error case. |
test/read_write_concern/write-concern-errors/aggregate.json |
Covers write concern errors for $out and $merge. |
test/asynchronous/test_read_write_concern_spec.py |
Registers the new asynchronous unified tests. |
.evergreen/resync-specs.sh |
Imports write concern error tests during spec sync. |
Review effort: Balanced
sleepyStick
approved these changes
Oct 27, 2026
sleepyStick
reviewed
Oct 27, 2026
sleepyStick
left a comment
Contributor
There was a problem hiding this comment.
(wait are the failures related to the spec sync? if not, then LGTM, but if it is, i take it back -- i didn't realize how many test failures there were....)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PYTHON-6181
Changes in this PR
Sync spec tests for mandated write concern error reporting. No functional changes, only spec test syncs.
Test Plan
Spec test sync.
Checklist
Checklist for Author
Checklist for Reviewer