Repository navigation
PYTHON-6181 Sync write concern error spec tests - #3155
Conversation
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
left a comment
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....)
They are related, fixed! |

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