| 1 | { |
| 2 | "runOn": [ |
| 3 | { |
| 4 | "minServerVersion": "4.0", |
| 5 | "topology": [ |
| 6 | "replicaset" |
| 7 | ] |
| 8 | } |
| 9 | ], |
| 10 | "database_name": "transaction-tests", |
| 11 | "collection_name": "test", |
| 12 | "data": [], |
| 13 | "tests": [ |
| 14 | { |
| 15 | "description": "readConcern snapshot in startTransaction options", |
| 16 | "sessionOptions": { |
| 17 | "session0": { |
| 18 | "defaultTransactionOptions": { |
| 19 | "readConcern": { |
| 20 | "level": "majority" |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | }, |
| 25 | "operations": [ |
| 26 | { |
| 27 | "name": "startTransaction", |
| 28 | "object": "session0", |
| 29 | "arguments": { |
| 30 | "options": { |
| 31 | "readConcern": { |
| 32 | "level": "snapshot" |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | }, |
| 37 | { |
| 38 | "name": "insertOne", |
| 39 | "object": "collection", |
| 40 | "arguments": { |
| 41 | "session": "session0", |
| 42 | "document": { |
| 43 | "_id": 1 |
| 44 | } |
| 45 | }, |
| 46 | "result": { |
| 47 | "insertedId": 1 |
| 48 | } |
| 49 | }, |
| 50 | { |
| 51 | "name": "commitTransaction", |
| 52 | "object": "session0" |
| 53 | }, |
| 54 | { |
| 55 | "name": "startTransaction", |
| 56 | "object": "session0", |
| 57 | "arguments": { |
| 58 | "options": { |
| 59 | "readConcern": { |
| 60 | "level": "snapshot" |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | }, |
| 65 | { |
| 66 | "name": "insertOne", |
| 67 | "object": "collection", |
| 68 | "arguments": { |
| 69 | "session": "session0", |
| 70 | "document": { |
| 71 | "_id": 2 |
| 72 | } |
| 73 | }, |
| 74 | "result": { |
| 75 | "insertedId": 2 |
| 76 | } |
| 77 | }, |
| 78 | { |
| 79 | "name": "abortTransaction", |
| 80 | "object": "session0" |
| 81 | } |
| 82 | ], |
| 83 | "expectations": [ |
| 84 | { |
| 85 | "command_started_event": { |
| 86 | "command": { |
| 87 | "insert": "test", |
| 88 | "documents": [ |
| 89 | { |
| 90 | "_id": 1 |
| 91 | } |
| 92 | ], |
| 93 | "ordered": true, |
| 94 | "lsid": "session0", |
| 95 | "txnNumber": { |
| 96 | "$numberLong": "1" |
| 97 | }, |
| 98 | "startTransaction": true, |
| 99 | "autocommit": false, |
| 100 | "readConcern": { |
| 101 | "level": "snapshot" |
| 102 | }, |
| 103 | "writeConcern": null |
| 104 | }, |
| 105 | "command_name": "insert", |
| 106 | "database_name": "transaction-tests" |
| 107 | } |
| 108 | }, |
| 109 | { |
| 110 | "command_started_event": { |
| 111 | "command": { |
| 112 | "commitTransaction": 1, |
| 113 | "lsid": "session0", |
| 114 | "txnNumber": { |
| 115 | "$numberLong": "1" |
| 116 | }, |
| 117 | "startTransaction": null, |
| 118 | "autocommit": false, |
| 119 | "readConcern": null, |
| 120 | "writeConcern": null |
| 121 | }, |
| 122 | "command_name": "commitTransaction", |
| 123 | "database_name": "admin" |
| 124 | } |
| 125 | }, |
| 126 | { |
| 127 | "command_started_event": { |
| 128 | "command": { |
| 129 | "insert": "test", |
| 130 | "documents": [ |
| 131 | { |
| 132 | "_id": 2 |
| 133 | } |
| 134 | ], |
| 135 | "ordered": true, |
| 136 | "lsid": "session0", |
| 137 | "txnNumber": { |
| 138 | "$numberLong": "2" |
| 139 | }, |
| 140 | "startTransaction": true, |
| 141 | "autocommit": false, |
| 142 | "readConcern": { |
| 143 | "level": "snapshot", |
| 144 | "afterClusterTime": 42 |
| 145 | }, |
| 146 | "writeConcern": null |
| 147 | }, |
| 148 | "command_name": "insert", |
| 149 | "database_name": "transaction-tests" |
| 150 | } |
| 151 | }, |
| 152 | { |
| 153 | "command_started_event": { |
| 154 | "command": { |
| 155 | "abortTransaction": 1, |
| 156 | "lsid": "session0", |
| 157 | "txnNumber": { |
| 158 | "$numberLong": "2" |
| 159 | }, |
| 160 | "startTransaction": null, |
| 161 | "autocommit": false, |
| 162 | "readConcern": null, |
| 163 | "writeConcern": null |
| 164 | }, |
| 165 | "command_name": "abortTransaction", |
| 166 | "database_name": "admin" |
| 167 | } |
| 168 | } |
| 169 | ], |
| 170 | "outcome": { |
| 171 | "collection": { |
| 172 | "data": [ |
| 173 | { |
| 174 | "_id": 1 |
| 175 | } |
| 176 | ] |
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | ] |
| 181 | } |