[CDRIVER-2456] test_bulk_write should have different behaviors depending on server version Created: 08/Jan/18  Updated: 28/Oct/23  Resolved: 29/Jan/18

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.10.0

Type: Task Priority: Major - P3
Reporter: Pavithra Vetriselvan Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible

 Description   

In test-mongoc-command-monitoring.c, test_bulk_write runs a bulk operation and then checks to see if the events BSON matches the expected events object in bulkWrite.yml and bulkWrite.json.

In the expected output, we expect a

{ "reply": "ok" }

for both acknowledged and unacknowledged writes. This is only correct when interacting with server versions below 3.6.

Starting in 3.6, we use OP_MSG to handle wc: 0 and should no longer expect a server reply.

We should add a flag in bulkWrite.yml and bulkWrite.json that indicates whether or not we should be using OP_MSG so that we can skip tests accordingly.



 Comments   
Comment by Githook User [ 29/Jan/18 ]

Author:

{'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis'}

Message: CDRIVER-2456 update test for unack'ed OP_MSG
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0b82e7dd9d3574cb49a0776a4cbf6a1b492316f6

Comment by Gregory McKeon (Inactive) [ 29/Jan/18 ]

jesse assigning to you to clear Pavi's queue.

Comment by A. Jesse Jiryu Davis [ 18/Jan/18 ]

Nevermind about the SPEC ticket, just update the C Driver test to consider an unacknowledged command that succeeds with outcome {} is equivalent to {ok: 1} for the sake of passing the spec tests.

Comment by A. Jesse Jiryu Davis [ 08/Jan/18 ]

Right. Open a SPEC ticket and propose a fix to the original test in the mongodb/specifications repo for all drivers. Then we’ll copy the fix to the C Driver.

Generated at Wed Feb 07 21:15:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.