database_name: &database_name "ruby-driver" collection_name: &collection_name "transactions-tests" data: [] tests: - description: insert operations: - name: startTransaction object: session0 - name: insertOne object: collection arguments: session: session0 document: _id: 1 result: insertedId: 1 - name: insertMany object: collection arguments: documents: - _id: 2 - _id: 3 session: session0 result: insertedIds: {0: 2, 1: 3} - name: insertOne object: collection arguments: session: session0 document: _id: 4 result: insertedId: 4 - name: commitTransaction object: session0 - name: startTransaction object: session0 - name: insertOne object: collection arguments: session: session0 document: _id: 5 result: insertedId: 5 - name: commitTransaction object: session0 expectations: - command_started_event: command: insert: *collection_name documents: - _id: 1 ordered: true readConcern: lsid: session0 txnNumber: $numberLong: "1" startTransaction: true autocommit: false writeConcern: command_name: insert database_name: *database_name - command_started_event: command: insert: *collection_name documents: - _id: 2 - _id: 3 ordered: true lsid: session0 txnNumber: $numberLong: "1" startTransaction: autocommit: false writeConcern: command_name: insert database_name: *database_name - command_started_event: command: insert: *collection_name documents: - _id: 4 ordered: true lsid: session0 txnNumber: $numberLong: "1" autocommit: false writeConcern: command_name: insert database_name: *database_name - command_started_event: command: commitTransaction: 1 lsid: session0 txnNumber: $numberLong: "1" startTransaction: autocommit: false writeConcern: command_name: commitTransaction database_name: admin - command_started_event: command: insert: *collection_name documents: - _id: 5 ordered: true readConcern: afterClusterTime: 42 lsid: session0 txnNumber: $numberLong: "2" startTransaction: true autocommit: false writeConcern: command_name: insert database_name: *database_name - command_started_event: command: commitTransaction: 1 lsid: session0 txnNumber: $numberLong: "2" startTransaction: autocommit: false writeConcern: command_name: commitTransaction database_name: admin outcome: collection: data: - _id: 1 - _id: 2 - _id: 3 - _id: 4 - _id: 5 # This test proves that the driver parses the collectionOptions writeConcern. - description: collection writeConcern without transaction operations: - name: insertOne object: collection collectionOptions: writeConcern: w: majority arguments: session: session0 document: _id: 1 result: insertedId: 1 expectations: - command_started_event: command: insert: *collection_name documents: - _id: 1 ordered: true readConcern: lsid: session0 txnNumber: startTransaction: autocommit: writeConcern: w: majority command_name: insert database_name: *database_name outcome: collection: data: - _id: 1 - description: collection writeConcern ignored for insert operations: - name: startTransaction object: session0 arguments: options: writeConcern: w: majority - name: insertOne object: collection collectionOptions: writeConcern: w: majority arguments: session: session0 document: _id: 1 result: insertedId: 1 - name: insertMany object: collection collectionOptions: writeConcern: w: majority arguments: documents: - _id: 2 - _id: 3 session: session0 result: insertedIds: {0: 2, 1: 3} - name: commitTransaction object: session0 expectations: - command_started_event: command: insert: *collection_name documents: - _id: 1 ordered: true readConcern: lsid: session0 txnNumber: $numberLong: "1" startTransaction: true autocommit: false writeConcern: command_name: insert database_name: *database_name - command_started_event: command: insert: *collection_name documents: - _id: 2 - _id: 3 ordered: true lsid: session0 txnNumber: $numberLong: "1" startTransaction: autocommit: false writeConcern: command_name: insert database_name: *database_name - command_started_event: command: commitTransaction: 1 lsid: session0 txnNumber: $numberLong: "1" startTransaction: autocommit: false writeConcern: w: majority command_name: commitTransaction database_name: admin outcome: collection: data: - _id: 1 - _id: 2 - _id: 3