Skip to content

PYTHON-6181 Sync write concern error spec tests - #3155

Open
NoahStapp wants to merge 2 commits into
mongodb:mainfrom
NoahStapp:PYTHON-6181
Open

NoahStapp wants to merge 2 commits into
mongodb:mainfrom
NoahStapp:PYTHON-6181

Conversation

@NoahStapp

Copy link
Copy Markdown
Contributor

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

  • Did you update the changelog (if necessary)?
  • Is there test coverage?
  • Is any followup work tracked in a JIRA ticket? If so, add link(s).

Checklist for Reviewer

  • Does the title of the PR reference a JIRA Ticket?
  • Do you fully understand the implementation? (Would you be comfortable explaining how this code works to someone else?)
  • Is all relevant documentation (README or docstring) updated?

Copilot AI balanced review requested due to automatic review settings October 27, 2026 19:43
@NoahStapp
NoahStapp requested a review from a team as a code owner October 27, 2026 19:43
@NoahStapp
NoahStapp requested a review from sleepyStick October 27, 2026 19:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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

Comment thread test/read_write_concern/write-concern-errors/client-bulkWrite.json

@sleepyStick sleepyStick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(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

No deployments
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.

3 participants