| 1 | { |
| 2 | "runOn": [ |
| 3 | { |
| 4 | "minServerVersion": "4.3.4", |
| 5 | "topology": [ |
| 6 | "replicaset", |
| 7 | "sharded" |
| 8 | ] |
| 9 | } |
| 10 | ], |
| 11 | "database_name": "transaction-tests", |
| 12 | "collection_name": "test", |
| 13 | "data": [], |
| 14 | "tests": [ |
| 15 | { |
| 16 | "description": "create index on a non-existing collection", |
| 17 | "operations": [ |
| 18 | { |
| 19 | "name": "dropCollection", |
| 20 | "object": "database", |
| 21 | "arguments": { |
| 22 | "collection": "test" |
| 23 | } |
| 24 | }, |
| 25 | { |
| 26 | "name": "startTransaction", |
| 27 | "object": "session0" |
| 28 | }, |
| 29 | { |
| 30 | "name": "createIndex", |
| 31 | "object": "collection", |
| 32 | "arguments": { |
| 33 | "session": "session0", |
| 34 | "name": "t_1", |
| 35 | "keys": { |
| 36 | "x": 1 |
| 37 | } |
| 38 | } |
| 39 | }, |
| 40 | { |
| 41 | "name": "assertIndexNotExists", |
| 42 | "object": "testRunner", |
| 43 | "arguments": { |
| 44 | "database": "transaction-tests", |
| 45 | "collection": "test", |
| 46 | "index": "t_1" |
| 47 | } |
| 48 | }, |
| 49 | { |
| 50 | "name": "commitTransaction", |
| 51 | "object": "session0" |
| 52 | }, |
| 53 | { |
| 54 | "name": "assertIndexExists", |
| 55 | "object": "testRunner", |
| 56 | "arguments": { |
| 57 | "database": "transaction-tests", |
| 58 | "collection": "test", |
| 59 | "index": "t_1" |
| 60 | } |
| 61 | } |
| 62 | ], |
| 63 | "expectations": [ |
| 64 | { |
| 65 | "command_started_event": { |
| 66 | "command": { |
| 67 | "drop": "test", |
| 68 | "writeConcern": null |
| 69 | }, |
| 70 | "command_name": "drop", |
| 71 | "database_name": "transaction-tests" |
| 72 | } |
| 73 | }, |
| 74 | { |
| 75 | "command_started_event": { |
| 76 | "command": { |
| 77 | "createIndexes": "test", |
| 78 | "indexes": [ |
| 79 | { |
| 80 | "name": "t_1", |
| 81 | "key": { |
| 82 | "x": 1 |
| 83 | } |
| 84 | } |
| 85 | ], |
| 86 | "lsid": "session0", |
| 87 | "txnNumber": { |
| 88 | "$numberLong": "1" |
| 89 | }, |
| 90 | "startTransaction": true, |
| 91 | "autocommit": false, |
| 92 | "writeConcern": null |
| 93 | }, |
| 94 | "command_name": "createIndexes", |
| 95 | "database_name": "transaction-tests" |
| 96 | } |
| 97 | }, |
| 98 | { |
| 99 | "command_started_event": { |
| 100 | "command": { |
| 101 | "commitTransaction": 1, |
| 102 | "lsid": "session0", |
| 103 | "txnNumber": { |
| 104 | "$numberLong": "1" |
| 105 | }, |
| 106 | "startTransaction": null, |
| 107 | "autocommit": false, |
| 108 | "writeConcern": null |
| 109 | }, |
| 110 | "command_name": "commitTransaction", |
| 111 | "database_name": "admin" |
| 112 | } |
| 113 | } |
| 114 | ] |
| 115 | }, |
| 116 | { |
| 117 | "description": "create index on a collection created within the same transaction", |
| 118 | "operations": [ |
| 119 | { |
| 120 | "name": "dropCollection", |
| 121 | "object": "database", |
| 122 | "arguments": { |
| 123 | "collection": "test" |
| 124 | } |
| 125 | }, |
| 126 | { |
| 127 | "name": "startTransaction", |
| 128 | "object": "session0" |
| 129 | }, |
| 130 | { |
| 131 | "name": "createCollection", |
| 132 | "object": "database", |
| 133 | "arguments": { |
| 134 | "session": "session0", |
| 135 | "collection": "test" |
| 136 | } |
| 137 | }, |
| 138 | { |
| 139 | "name": "createIndex", |
| 140 | "object": "collection", |
| 141 | "arguments": { |
| 142 | "session": "session0", |
| 143 | "name": "t_1", |
| 144 | "keys": { |
| 145 | "x": 1 |
| 146 | } |
| 147 | } |
| 148 | }, |
| 149 | { |
| 150 | "name": "assertIndexNotExists", |
| 151 | "object": "testRunner", |
| 152 | "arguments": { |
| 153 | "database": "transaction-tests", |
| 154 | "collection": "test", |
| 155 | "index": "t_1" |
| 156 | } |
| 157 | }, |
| 158 | { |
| 159 | "name": "commitTransaction", |
| 160 | "object": "session0" |
| 161 | }, |
| 162 | { |
| 163 | "name": "assertIndexExists", |
| 164 | "object": "testRunner", |
| 165 | "arguments": { |
| 166 | "database": "transaction-tests", |
| 167 | "collection": "test", |
| 168 | "index": "t_1" |
| 169 | } |
| 170 | } |
| 171 | ], |
| 172 | "expectations": [ |
| 173 | { |
| 174 | "command_started_event": { |
| 175 | "command": { |
| 176 | "drop": "test", |
| 177 | "writeConcern": null |
| 178 | }, |
| 179 | "command_name": "drop", |
| 180 | "database_name": "transaction-tests" |
| 181 | } |
| 182 | }, |
| 183 | { |
| 184 | "command_started_event": { |
| 185 | "command": { |
| 186 | "create": "test", |
| 187 | "lsid": "session0", |
| 188 | "txnNumber": { |
| 189 | "$numberLong": "1" |
| 190 | }, |
| 191 | "startTransaction": true, |
| 192 | "autocommit": false, |
| 193 | "writeConcern": null |
| 194 | }, |
| 195 | "command_name": "create", |
| 196 | "database_name": "transaction-tests" |
| 197 | } |
| 198 | }, |
| 199 | { |
| 200 | "command_started_event": { |
| 201 | "command": { |
| 202 | "createIndexes": "test", |
| 203 | "indexes": [ |
| 204 | { |
| 205 | "name": "t_1", |
| 206 | "key": { |
| 207 | "x": 1 |
| 208 | } |
| 209 | } |
| 210 | ], |
| 211 | "lsid": "session0", |
| 212 | "writeConcern": null |
| 213 | }, |
| 214 | "command_name": "createIndexes", |
| 215 | "database_name": "transaction-tests" |
| 216 | } |
| 217 | }, |
| 218 | { |
| 219 | "command_started_event": { |
| 220 | "command": { |
| 221 | "commitTransaction": 1, |
| 222 | "lsid": "session0", |
| 223 | "txnNumber": { |
| 224 | "$numberLong": "1" |
| 225 | }, |
| 226 | "startTransaction": null, |
| 227 | "autocommit": false, |
| 228 | "writeConcern": null |
| 229 | }, |
| 230 | "command_name": "commitTransaction", |
| 231 | "database_name": "admin" |
| 232 | } |
| 233 | } |
| 234 | ] |
| 235 | } |
| 236 | ] |
| 237 | } |