|
27 | 27 | "awaitMinPoolSizeMS": 10000, |
28 | 28 | "useMultipleMongoses": false, |
29 | 29 | "observeEvents": [ |
30 | | - "commandStartedEvent" |
| 30 | + "commandStartedEvent", |
| 31 | + "commandFailedEvent" |
31 | 32 | ] |
32 | 33 | } |
33 | 34 | }, |
|
188 | 189 | } |
189 | 190 | } |
190 | 191 | }, |
| 192 | + { |
| 193 | + "commandFailedEvent": { |
| 194 | + "commandName": "insert" |
| 195 | + } |
| 196 | + }, |
191 | 197 | { |
192 | 198 | "commandStartedEvent": { |
193 | 199 | "commandName": "abortTransaction", |
|
206 | 212 | ] |
207 | 213 | } |
208 | 214 | ] |
| 215 | + }, |
| 216 | + { |
| 217 | + "description": "withTransaction surfaces a timeout after exhausting transient transaction retries, retaining the last transient error as the timeout cause.", |
| 218 | + "operations": [ |
| 219 | + { |
| 220 | + "name": "failPoint", |
| 221 | + "object": "testRunner", |
| 222 | + "arguments": { |
| 223 | + "client": "failPointClient", |
| 224 | + "failPoint": { |
| 225 | + "configureFailPoint": "failCommand", |
| 226 | + "mode": "alwaysOn", |
| 227 | + "data": { |
| 228 | + "failCommands": [ |
| 229 | + "insert" |
| 230 | + ], |
| 231 | + "blockConnection": true, |
| 232 | + "blockTimeMS": 25, |
| 233 | + "errorCode": 24, |
| 234 | + "errorLabels": [ |
| 235 | + "TransientTransactionError" |
| 236 | + ] |
| 237 | + } |
| 238 | + } |
| 239 | + } |
| 240 | + }, |
| 241 | + { |
| 242 | + "name": "withTransaction", |
| 243 | + "object": "session", |
| 244 | + "arguments": { |
| 245 | + "callback": [ |
| 246 | + { |
| 247 | + "name": "insertOne", |
| 248 | + "object": "collection", |
| 249 | + "arguments": { |
| 250 | + "document": { |
| 251 | + "_id": 1 |
| 252 | + }, |
| 253 | + "session": "session" |
| 254 | + }, |
| 255 | + "expectError": { |
| 256 | + "isError": true |
| 257 | + } |
| 258 | + } |
| 259 | + ] |
| 260 | + }, |
| 261 | + "expectError": { |
| 262 | + "isTimeoutError": true |
| 263 | + } |
| 264 | + } |
| 265 | + ], |
| 266 | + "expectEvents": [ |
| 267 | + { |
| 268 | + "client": "client", |
| 269 | + "ignoreExtraEvents": true, |
| 270 | + "events": [ |
| 271 | + { |
| 272 | + "commandStartedEvent": { |
| 273 | + "commandName": "insert" |
| 274 | + } |
| 275 | + }, |
| 276 | + { |
| 277 | + "commandFailedEvent": { |
| 278 | + "commandName": "insert" |
| 279 | + } |
| 280 | + }, |
| 281 | + { |
| 282 | + "commandStartedEvent": { |
| 283 | + "commandName": "abortTransaction" |
| 284 | + } |
| 285 | + }, |
| 286 | + { |
| 287 | + "commandFailedEvent": { |
| 288 | + "commandName": "abortTransaction" |
| 289 | + } |
| 290 | + }, |
| 291 | + { |
| 292 | + "commandStartedEvent": { |
| 293 | + "commandName": "insert" |
| 294 | + } |
| 295 | + }, |
| 296 | + { |
| 297 | + "commandFailedEvent": { |
| 298 | + "commandName": "insert" |
| 299 | + } |
| 300 | + }, |
| 301 | + { |
| 302 | + "commandStartedEvent": { |
| 303 | + "commandName": "abortTransaction" |
| 304 | + } |
| 305 | + }, |
| 306 | + { |
| 307 | + "commandFailedEvent": { |
| 308 | + "commandName": "abortTransaction" |
| 309 | + } |
| 310 | + } |
| 311 | + ] |
| 312 | + } |
| 313 | + ] |
209 | 314 | } |
210 | 315 | ] |
211 | 316 | } |
0 commit comments