| 1 | runOn: |
| 2 | - |
| 3 | minServerVersion: "4.0" |
| 4 | topology: ["replicaset"] |
| 5 | - |
| 6 | minServerVersion: "4.1.8" |
| 7 | topology: ["sharded"] |
| 8 | |
| 9 | database_name: &database_name "transaction-tests" |
| 10 | collection_name: &collection_name "test" |
| 11 | |
| 12 | data: |
| 13 | - _id: 1 |
| 14 | - _id: 2 |
| 15 | - _id: 3 |
| 16 | |
| 17 | tests: |
| 18 | - description: findOneAndDelete |
| 19 | |
| 20 | operations: |
| 21 | - name: startTransaction |
| 22 | object: session0 |
| 23 | - name: findOneAndDelete |
| 24 | object: collection |
| 25 | arguments: |
| 26 | session: session0 |
| 27 | filter: {_id: 3} |
| 28 | result: {_id: 3} |
| 29 | - name: findOneAndDelete |
| 30 | object: collection |
| 31 | arguments: |
| 32 | session: session0 |
| 33 | filter: {_id: 4} |
| 34 | result: |
| 35 | - name: commitTransaction |
| 36 | object: session0 |
| 37 | |
| 38 | expectations: |
| 39 | - command_started_event: |
| 40 | command: |
| 41 | findAndModify: *collection_name |
| 42 | query: {_id: 3} |
| 43 | remove: True |
| 44 | lsid: session0 |
| 45 | txnNumber: |
| 46 | $numberLong: "1" |
| 47 | startTransaction: true |
| 48 | autocommit: false |
| 49 | readConcern: |
| 50 | writeConcern: |
| 51 | command_name: findAndModify |
| 52 | database_name: *database_name |
| 53 | - command_started_event: |
| 54 | command: |
| 55 | findAndModify: *collection_name |
| 56 | query: {_id: 4} |
| 57 | remove: True |
| 58 | lsid: session0 |
| 59 | txnNumber: |
| 60 | $numberLong: "1" |
| 61 | startTransaction: |
| 62 | autocommit: false |
| 63 | readConcern: |
| 64 | writeConcern: |
| 65 | command_name: findAndModify |
| 66 | database_name: *database_name |
| 67 | - command_started_event: |
| 68 | command: |
| 69 | commitTransaction: 1 |
| 70 | lsid: session0 |
| 71 | txnNumber: |
| 72 | $numberLong: "1" |
| 73 | startTransaction: |
| 74 | autocommit: false |
| 75 | readConcern: |
| 76 | writeConcern: |
| 77 | command_name: commitTransaction |
| 78 | database_name: admin |
| 79 | |
| 80 | outcome: |
| 81 | collection: |
| 82 | data: |
| 83 | - {_id: 1} |
| 84 | - {_id: 2} |
| 85 | |
| 86 | - description: collection writeConcern ignored for findOneAndDelete |
| 87 | |
| 88 | operations: |
| 89 | - name: startTransaction |
| 90 | object: session0 |
| 91 | arguments: |
| 92 | options: |
| 93 | writeConcern: |
| 94 | w: majority |
| 95 | - name: findOneAndDelete |
| 96 | object: collection |
| 97 | collectionOptions: |
| 98 | writeConcern: |
| 99 | w: majority |
| 100 | arguments: |
| 101 | session: session0 |
| 102 | filter: {_id: 3} |
| 103 | result: {_id: 3} |
| 104 | - name: commitTransaction |
| 105 | object: session0 |
| 106 | |
| 107 | expectations: |
| 108 | - command_started_event: |
| 109 | command: |
| 110 | findAndModify: *collection_name |
| 111 | query: {_id: 3} |
| 112 | remove: True |
| 113 | lsid: session0 |
| 114 | txnNumber: |
| 115 | $numberLong: "1" |
| 116 | startTransaction: true |
| 117 | autocommit: false |
| 118 | readConcern: |
| 119 | writeConcern: |
| 120 | command_name: findAndModify |
| 121 | database_name: *database_name |
| 122 | - command_started_event: |
| 123 | command: |
| 124 | commitTransaction: 1 |
| 125 | lsid: session0 |
| 126 | txnNumber: |
| 127 | $numberLong: "1" |
| 128 | startTransaction: |
| 129 | autocommit: false |
| 130 | readConcern: |
| 131 | writeConcern: |
| 132 | w: majority |
| 133 | command_name: commitTransaction |
| 134 | database_name: admin |