# Assumes the default for transactions is the same as for all ops, tests # setting the writeConcern to "majority". database_name: &database_name "ruby-driver" collection_name: &collection_name "transactions-tests" data: [] tests: - description: commit with majority operations: - name: startTransaction object: session0 arguments: options: writeConcern: w: majority - name: insertOne object: collection arguments: session: session0 document: _id: 1 result: insertedId: 1 - 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: commitTransaction: 1 lsid: session0 txnNumber: $numberLong: "1" startTransaction: autocommit: false writeConcern: w: majority command_name: commitTransaction database_name: admin outcome: collection: data: - _id: 1 - description: commit with default operations: - name: startTransaction object: session0 - name: insertOne object: collection arguments: session: session0 document: _id: 1 result: insertedId: 1 - 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: commitTransaction: 1 lsid: session0 txnNumber: $numberLong: "1" startTransaction: autocommit: false writeConcern: command_name: commitTransaction database_name: admin outcome: collection: data: - _id: 1 - description: abort with majority operations: - name: startTransaction object: session0 arguments: options: writeConcern: w: majority - name: insertOne object: collection arguments: session: session0 document: _id: 1 result: insertedId: 1 - name: abortTransaction 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: abortTransaction: 1 lsid: session0 txnNumber: $numberLong: "1" startTransaction: autocommit: false writeConcern: w: majority command_name: abortTransaction database_name: admin outcome: collection: data: [] - description: abort with default operations: - name: startTransaction object: session0 - name: insertOne object: collection arguments: session: session0 document: _id: 1 result: insertedId: 1 - name: abortTransaction 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: abortTransaction: 1 lsid: session0 txnNumber: $numberLong: "1" startTransaction: autocommit: false writeConcern: command_name: abortTransaction database_name: admin outcome: collection: data: [] - description: start with unacknowledged write concern operations: - name: startTransaction object: session0 arguments: options: writeConcern: w: 0 result: # Client-side error. errorContains: transactions do not support unacknowledged write concern - description: start with implicit unacknowledged write concern clientOptions: w: 0 operations: - name: startTransaction object: session0 result: # Client-side error. errorContains: transactions do not support unacknowledged write concern