[DRIVERS-809] Improve testing around default writeConcern Created: 31/Jan/20  Updated: 03/Feb/20  Resolved: 03/Feb/20

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends

 Description   

The existing tests for writeConcern imply that an empty document is a valid writeConcern to send to the server.

https://github.com/mongodb/specifications/blob/master/source/read-write-concern/tests/document/write-concern.json#L3-L10

In fact, the default writeConcern is no writeConcern (i.e. don't send the writeConcern field at all). This has come up in the past related to drivers accidentally overriding getLastErrorDefaults. It is coming up again in relation to PM-900.

There have been two bugs filed and fixed in drivers related to this - CDRIVER-2273 and PYTHON-1523. Other drivers may have the same bug, since our existing tests don't catch it.

Please add tests to ensure that drivers don't add the writeConcern option with an empty document to write commands when the application has not specified a write concern.



 Comments   
Comment by Esha Bhargava [ 03/Feb/20 ]

Same as DRIVERS-440

Generated at Thu Feb 08 08:22:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.