| 1 | { |
| 2 | "runOn": [ |
| 3 | { |
| 4 | "minServerVersion": "4.0", |
| 5 | "topology": [ |
| 6 | "replicaset" |
| 7 | ] |
| 8 | }, |
| 9 | { |
| 10 | "minServerVersion": "4.1.8", |
| 11 | "topology": [ |
| 12 | "sharded" |
| 13 | ] |
| 14 | } |
| 15 | ], |
| 16 | "database_name": "transaction-tests", |
| 17 | "collection_name": "test", |
| 18 | "data": [], |
| 19 | "tests": [ |
| 20 | { |
| 21 | "description": "commit", |
| 22 | "operations": [ |
| 23 | { |
| 24 | "name": "startTransaction", |
| 25 | "object": "session0" |
| 26 | }, |
| 27 | { |
| 28 | "name": "insertOne", |
| 29 | "object": "collection", |
| 30 | "arguments": { |
| 31 | "session": "session0", |
| 32 | "document": { |
| 33 | "_id": 1 |
| 34 | } |
| 35 | }, |
| 36 | "result": { |
| 37 | "insertedId": 1 |
| 38 | } |
| 39 | }, |
| 40 | { |
| 41 | "name": "commitTransaction", |
| 42 | "object": "session0" |
| 43 | }, |
| 44 | { |
| 45 | "name": "startTransaction", |
| 46 | "object": "session0" |
| 47 | }, |
| 48 | { |
| 49 | "name": "insertOne", |
| 50 | "object": "collection", |
| 51 | "arguments": { |
| 52 | "session": "session0", |
| 53 | "document": { |
| 54 | "_id": 2 |
| 55 | } |
| 56 | }, |
| 57 | "result": { |
| 58 | "insertedId": 2 |
| 59 | } |
| 60 | }, |
| 61 | { |
| 62 | "name": "commitTransaction", |
| 63 | "object": "session0" |
| 64 | } |
| 65 | ], |
| 66 | "expectations": [ |
| 67 | { |
| 68 | "command_started_event": { |
| 69 | "command": { |
| 70 | "insert": "test", |
| 71 | "documents": [ |
| 72 | { |
| 73 | "_id": 1 |
| 74 | } |
| 75 | ], |
| 76 | "ordered": true, |
| 77 | "readConcern": null, |
| 78 | "lsid": "session0", |
| 79 | "txnNumber": { |
| 80 | "$numberLong": "1" |
| 81 | }, |
| 82 | "startTransaction": true, |
| 83 | "autocommit": false, |
| 84 | "writeConcern": null |
| 85 | }, |
| 86 | "command_name": "insert", |
| 87 | "database_name": "transaction-tests" |
| 88 | } |
| 89 | }, |
| 90 | { |
| 91 | "command_started_event": { |
| 92 | "command": { |
| 93 | "commitTransaction": 1, |
| 94 | "lsid": "session0", |
| 95 | "txnNumber": { |
| 96 | "$numberLong": "1" |
| 97 | }, |
| 98 | "startTransaction": null, |
| 99 | "autocommit": false, |
| 100 | "writeConcern": null |
| 101 | }, |
| 102 | "command_name": "commitTransaction", |
| 103 | "database_name": "admin" |
| 104 | } |
| 105 | }, |
| 106 | { |
| 107 | "command_started_event": { |
| 108 | "command": { |
| 109 | "insert": "test", |
| 110 | "documents": [ |
| 111 | { |
| 112 | "_id": 2 |
| 113 | } |
| 114 | ], |
| 115 | "ordered": true, |
| 116 | "readConcern": { |
| 117 | "afterClusterTime": 42 |
| 118 | }, |
| 119 | "lsid": "session0", |
| 120 | "txnNumber": { |
| 121 | "$numberLong": "2" |
| 122 | }, |
| 123 | "startTransaction": true, |
| 124 | "autocommit": false, |
| 125 | "writeConcern": null |
| 126 | }, |
| 127 | "command_name": "insert", |
| 128 | "database_name": "transaction-tests" |
| 129 | } |
| 130 | }, |
| 131 | { |
| 132 | "command_started_event": { |
| 133 | "command": { |
| 134 | "commitTransaction": 1, |
| 135 | "lsid": "session0", |
| 136 | "txnNumber": { |
| 137 | "$numberLong": "2" |
| 138 | }, |
| 139 | "startTransaction": null, |
| 140 | "autocommit": false, |
| 141 | "writeConcern": null |
| 142 | }, |
| 143 | "command_name": "commitTransaction", |
| 144 | "database_name": "admin" |
| 145 | } |
| 146 | } |
| 147 | ], |
| 148 | "outcome": { |
| 149 | "collection": { |
| 150 | "data": [ |
| 151 | { |
| 152 | "_id": 1 |
| 153 | }, |
| 154 | { |
| 155 | "_id": 2 |
| 156 | } |
| 157 | ] |
| 158 | } |
| 159 | } |
| 160 | }, |
| 161 | { |
| 162 | "description": "rerun commit after empty transaction", |
| 163 | "operations": [ |
| 164 | { |
| 165 | "name": "startTransaction", |
| 166 | "object": "session0" |
| 167 | }, |
| 168 | { |
| 169 | "name": "commitTransaction", |
| 170 | "object": "session0" |
| 171 | }, |
| 172 | { |
| 173 | "name": "commitTransaction", |
| 174 | "object": "session0" |
| 175 | }, |
| 176 | { |
| 177 | "name": "startTransaction", |
| 178 | "object": "session0" |
| 179 | }, |
| 180 | { |
| 181 | "name": "insertOne", |
| 182 | "object": "collection", |
| 183 | "arguments": { |
| 184 | "session": "session0", |
| 185 | "document": { |
| 186 | "_id": 1 |
| 187 | } |
| 188 | }, |
| 189 | "result": { |
| 190 | "insertedId": 1 |
| 191 | } |
| 192 | }, |
| 193 | { |
| 194 | "name": "commitTransaction", |
| 195 | "object": "session0" |
| 196 | } |
| 197 | ], |
| 198 | "expectations": [ |
| 199 | { |
| 200 | "command_started_event": { |
| 201 | "command": { |
| 202 | "insert": "test", |
| 203 | "documents": [ |
| 204 | { |
| 205 | "_id": 1 |
| 206 | } |
| 207 | ], |
| 208 | "ordered": true, |
| 209 | "readConcern": null, |
| 210 | "lsid": "session0", |
| 211 | "txnNumber": { |
| 212 | "$numberLong": "2" |
| 213 | }, |
| 214 | "startTransaction": true, |
| 215 | "autocommit": false, |
| 216 | "writeConcern": null |
| 217 | }, |
| 218 | "command_name": "insert", |
| 219 | "database_name": "transaction-tests" |
| 220 | } |
| 221 | }, |
| 222 | { |
| 223 | "command_started_event": { |
| 224 | "command": { |
| 225 | "commitTransaction": 1, |
| 226 | "lsid": "session0", |
| 227 | "txnNumber": { |
| 228 | "$numberLong": "2" |
| 229 | }, |
| 230 | "startTransaction": null, |
| 231 | "autocommit": false, |
| 232 | "writeConcern": null |
| 233 | }, |
| 234 | "command_name": "commitTransaction", |
| 235 | "database_name": "admin" |
| 236 | } |
| 237 | } |
| 238 | ], |
| 239 | "outcome": { |
| 240 | "collection": { |
| 241 | "data": [ |
| 242 | { |
| 243 | "_id": 1 |
| 244 | } |
| 245 | ] |
| 246 | } |
| 247 | } |
| 248 | }, |
| 249 | { |
| 250 | "description": "multiple commits in a row", |
| 251 | "operations": [ |
| 252 | { |
| 253 | "name": "startTransaction", |
| 254 | "object": "session0" |
| 255 | }, |
| 256 | { |
| 257 | "name": "insertOne", |
| 258 | "object": "collection", |
| 259 | "arguments": { |
| 260 | "session": "session0", |
| 261 | "document": { |
| 262 | "_id": 1 |
| 263 | } |
| 264 | }, |
| 265 | "result": { |
| 266 | "insertedId": 1 |
| 267 | } |
| 268 | }, |
| 269 | { |
| 270 | "name": "commitTransaction", |
| 271 | "object": "session0" |
| 272 | }, |
| 273 | { |
| 274 | "name": "commitTransaction", |
| 275 | "object": "session0" |
| 276 | }, |
| 277 | { |
| 278 | "name": "commitTransaction", |
| 279 | "object": "session0" |
| 280 | } |
| 281 | ], |
| 282 | "expectations": [ |
| 283 | { |
| 284 | "command_started_event": { |
| 285 | "command": { |
| 286 | "insert": "test", |
| 287 | "documents": [ |
| 288 | { |
| 289 | "_id": 1 |
| 290 | } |
| 291 | ], |
| 292 | "ordered": true, |
| 293 | "readConcern": null, |
| 294 | "lsid": "session0", |
| 295 | "txnNumber": { |
| 296 | "$numberLong": "1" |
| 297 | }, |
| 298 | "startTransaction": true, |
| 299 | "autocommit": false, |
| 300 | "writeConcern": null |
| 301 | }, |
| 302 | "command_name": "insert", |
| 303 | "database_name": "transaction-tests" |
| 304 | } |
| 305 | }, |
| 306 | { |
| 307 | "command_started_event": { |
| 308 | "command": { |
| 309 | "commitTransaction": 1, |
| 310 | "lsid": "session0", |
| 311 | "txnNumber": { |
| 312 | "$numberLong": "1" |
| 313 | }, |
| 314 | "startTransaction": null, |
| 315 | "autocommit": false, |
| 316 | "writeConcern": null |
| 317 | }, |
| 318 | "command_name": "commitTransaction", |
| 319 | "database_name": "admin" |
| 320 | } |
| 321 | }, |
| 322 | { |
| 323 | "command_started_event": { |
| 324 | "command": { |
| 325 | "commitTransaction": 1, |
| 326 | "lsid": "session0", |
| 327 | "txnNumber": { |
| 328 | "$numberLong": "1" |
| 329 | }, |
| 330 | "startTransaction": null, |
| 331 | "autocommit": false, |
| 332 | "writeConcern": { |
| 333 | "w": "majority", |
| 334 | "wtimeout": 10000 |
| 335 | } |
| 336 | }, |
| 337 | "command_name": "commitTransaction", |
| 338 | "database_name": "admin" |
| 339 | } |
| 340 | }, |
| 341 | { |
| 342 | "command_started_event": { |
| 343 | "command": { |
| 344 | "commitTransaction": 1, |
| 345 | "lsid": "session0", |
| 346 | "txnNumber": { |
| 347 | "$numberLong": "1" |
| 348 | }, |
| 349 | "startTransaction": null, |
| 350 | "autocommit": false, |
| 351 | "writeConcern": { |
| 352 | "w": "majority", |
| 353 | "wtimeout": 10000 |
| 354 | } |
| 355 | }, |
| 356 | "command_name": "commitTransaction", |
| 357 | "database_name": "admin" |
| 358 | } |
| 359 | } |
| 360 | ], |
| 361 | "outcome": { |
| 362 | "collection": { |
| 363 | "data": [ |
| 364 | { |
| 365 | "_id": 1 |
| 366 | } |
| 367 | ] |
| 368 | } |
| 369 | } |
| 370 | }, |
| 371 | { |
| 372 | "description": "write concern error on commit", |
| 373 | "operations": [ |
| 374 | { |
| 375 | "name": "startTransaction", |
| 376 | "object": "session0", |
| 377 | "arguments": { |
| 378 | "options": { |
| 379 | "writeConcern": { |
| 380 | "w": 10 |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | }, |
| 385 | { |
| 386 | "name": "insertOne", |
| 387 | "object": "collection", |
| 388 | "arguments": { |
| 389 | "session": "session0", |
| 390 | "document": { |
| 391 | "_id": 1 |
| 392 | } |
| 393 | }, |
| 394 | "result": { |
| 395 | "insertedId": 1 |
| 396 | } |
| 397 | }, |
| 398 | { |
| 399 | "name": "commitTransaction", |
| 400 | "object": "session0", |
| 401 | "result": { |
| 402 | "errorLabelsOmit": [ |
| 403 | "TransientTransactionError", |
| 404 | "UnknownTransactionCommitResult" |
| 405 | ] |
| 406 | } |
| 407 | } |
| 408 | ], |
| 409 | "outcome": { |
| 410 | "collection": { |
| 411 | "data": [ |
| 412 | { |
| 413 | "_id": 1 |
| 414 | } |
| 415 | ] |
| 416 | } |
| 417 | } |
| 418 | }, |
| 419 | { |
| 420 | "description": "commit without start", |
| 421 | "operations": [ |
| 422 | { |
| 423 | "name": "commitTransaction", |
| 424 | "object": "session0", |
| 425 | "result": { |
| 426 | "errorContains": "no transaction started" |
| 427 | } |
| 428 | } |
| 429 | ], |
| 430 | "expectations": [], |
| 431 | "outcome": { |
| 432 | "collection": { |
| 433 | "data": [] |
| 434 | } |
| 435 | } |
| 436 | }, |
| 437 | { |
| 438 | "description": "commit after no-op abort", |
| 439 | "operations": [ |
| 440 | { |
| 441 | "name": "startTransaction", |
| 442 | "object": "session0" |
| 443 | }, |
| 444 | { |
| 445 | "name": "abortTransaction", |
| 446 | "object": "session0" |
| 447 | }, |
| 448 | { |
| 449 | "name": "commitTransaction", |
| 450 | "object": "session0", |
| 451 | "result": { |
| 452 | "errorContains": "Cannot call commitTransaction after calling abortTransaction" |
| 453 | } |
| 454 | } |
| 455 | ], |
| 456 | "expectations": [], |
| 457 | "outcome": { |
| 458 | "collection": { |
| 459 | "data": [] |
| 460 | } |
| 461 | } |
| 462 | }, |
| 463 | { |
| 464 | "description": "commit after abort", |
| 465 | "operations": [ |
| 466 | { |
| 467 | "name": "startTransaction", |
| 468 | "object": "session0" |
| 469 | }, |
| 470 | { |
| 471 | "name": "insertOne", |
| 472 | "object": "collection", |
| 473 | "arguments": { |
| 474 | "session": "session0", |
| 475 | "document": { |
| 476 | "_id": 1 |
| 477 | } |
| 478 | }, |
| 479 | "result": { |
| 480 | "insertedId": 1 |
| 481 | } |
| 482 | }, |
| 483 | { |
| 484 | "name": "abortTransaction", |
| 485 | "object": "session0" |
| 486 | }, |
| 487 | { |
| 488 | "name": "commitTransaction", |
| 489 | "object": "session0", |
| 490 | "result": { |
| 491 | "errorContains": "Cannot call commitTransaction after calling abortTransaction" |
| 492 | } |
| 493 | } |
| 494 | ], |
| 495 | "expectations": [ |
| 496 | { |
| 497 | "command_started_event": { |
| 498 | "command": { |
| 499 | "insert": "test", |
| 500 | "documents": [ |
| 501 | { |
| 502 | "_id": 1 |
| 503 | } |
| 504 | ], |
| 505 | "ordered": true, |
| 506 | "readConcern": null, |
| 507 | "lsid": "session0", |
| 508 | "txnNumber": { |
| 509 | "$numberLong": "1" |
| 510 | }, |
| 511 | "startTransaction": true, |
| 512 | "autocommit": false, |
| 513 | "writeConcern": null |
| 514 | }, |
| 515 | "command_name": "insert", |
| 516 | "database_name": "transaction-tests" |
| 517 | } |
| 518 | }, |
| 519 | { |
| 520 | "command_started_event": { |
| 521 | "command": { |
| 522 | "abortTransaction": 1, |
| 523 | "lsid": "session0", |
| 524 | "txnNumber": { |
| 525 | "$numberLong": "1" |
| 526 | }, |
| 527 | "startTransaction": null, |
| 528 | "autocommit": false, |
| 529 | "writeConcern": null |
| 530 | }, |
| 531 | "command_name": "abortTransaction", |
| 532 | "database_name": "admin" |
| 533 | } |
| 534 | } |
| 535 | ] |
| 536 | }, |
| 537 | { |
| 538 | "description": "multiple commits after empty transaction", |
| 539 | "operations": [ |
| 540 | { |
| 541 | "name": "startTransaction", |
| 542 | "object": "session0" |
| 543 | }, |
| 544 | { |
| 545 | "name": "insertOne", |
| 546 | "object": "collection", |
| 547 | "arguments": { |
| 548 | "session": "session0", |
| 549 | "document": { |
| 550 | "_id": 1 |
| 551 | } |
| 552 | }, |
| 553 | "result": { |
| 554 | "insertedId": 1 |
| 555 | } |
| 556 | }, |
| 557 | { |
| 558 | "name": "abortTransaction", |
| 559 | "object": "session0" |
| 560 | }, |
| 561 | { |
| 562 | "name": "startTransaction", |
| 563 | "object": "session0" |
| 564 | }, |
| 565 | { |
| 566 | "name": "commitTransaction", |
| 567 | "object": "session0" |
| 568 | }, |
| 569 | { |
| 570 | "name": "commitTransaction", |
| 571 | "object": "session0" |
| 572 | }, |
| 573 | { |
| 574 | "name": "startTransaction", |
| 575 | "object": "session0" |
| 576 | }, |
| 577 | { |
| 578 | "name": "insertOne", |
| 579 | "object": "collection", |
| 580 | "arguments": { |
| 581 | "session": "session0", |
| 582 | "document": { |
| 583 | "_id": 1 |
| 584 | } |
| 585 | }, |
| 586 | "result": { |
| 587 | "insertedId": 1 |
| 588 | } |
| 589 | }, |
| 590 | { |
| 591 | "name": "abortTransaction", |
| 592 | "object": "session0" |
| 593 | } |
| 594 | ], |
| 595 | "expectations": [ |
| 596 | { |
| 597 | "command_started_event": { |
| 598 | "command": { |
| 599 | "insert": "test", |
| 600 | "documents": [ |
| 601 | { |
| 602 | "_id": 1 |
| 603 | } |
| 604 | ], |
| 605 | "ordered": true, |
| 606 | "readConcern": null, |
| 607 | "lsid": "session0", |
| 608 | "txnNumber": { |
| 609 | "$numberLong": "1" |
| 610 | }, |
| 611 | "startTransaction": true, |
| 612 | "autocommit": false, |
| 613 | "writeConcern": null |
| 614 | }, |
| 615 | "command_name": "insert", |
| 616 | "database_name": "transaction-tests" |
| 617 | } |
| 618 | }, |
| 619 | { |
| 620 | "command_started_event": { |
| 621 | "command": { |
| 622 | "abortTransaction": 1, |
| 623 | "lsid": "session0", |
| 624 | "txnNumber": { |
| 625 | "$numberLong": "1" |
| 626 | }, |
| 627 | "startTransaction": null, |
| 628 | "autocommit": false, |
| 629 | "writeConcern": null |
| 630 | }, |
| 631 | "command_name": "abortTransaction", |
| 632 | "database_name": "admin" |
| 633 | } |
| 634 | }, |
| 635 | { |
| 636 | "command_started_event": { |
| 637 | "command": { |
| 638 | "insert": "test", |
| 639 | "documents": [ |
| 640 | { |
| 641 | "_id": 1 |
| 642 | } |
| 643 | ], |
| 644 | "ordered": true, |
| 645 | "readConcern": { |
| 646 | "afterClusterTime": 42 |
| 647 | }, |
| 648 | "lsid": "session0", |
| 649 | "txnNumber": { |
| 650 | "$numberLong": "3" |
| 651 | }, |
| 652 | "startTransaction": true, |
| 653 | "autocommit": false, |
| 654 | "writeConcern": null |
| 655 | }, |
| 656 | "command_name": "insert", |
| 657 | "database_name": "transaction-tests" |
| 658 | } |
| 659 | }, |
| 660 | { |
| 661 | "command_started_event": { |
| 662 | "command": { |
| 663 | "abortTransaction": 1, |
| 664 | "lsid": "session0", |
| 665 | "txnNumber": { |
| 666 | "$numberLong": "3" |
| 667 | }, |
| 668 | "startTransaction": null, |
| 669 | "autocommit": false, |
| 670 | "writeConcern": null |
| 671 | }, |
| 672 | "command_name": "abortTransaction", |
| 673 | "database_name": "admin" |
| 674 | } |
| 675 | } |
| 676 | ], |
| 677 | "outcome": { |
| 678 | "collection": { |
| 679 | "data": [] |
| 680 | } |
| 681 | } |
| 682 | }, |
| 683 | { |
| 684 | "description": "reset session state commit", |
| 685 | "clientOptions": { |
| 686 | "retryWrites": false |
| 687 | }, |
| 688 | "operations": [ |
| 689 | { |
| 690 | "name": "startTransaction", |
| 691 | "object": "session0" |
| 692 | }, |
| 693 | { |
| 694 | "name": "insertOne", |
| 695 | "object": "collection", |
| 696 | "arguments": { |
| 697 | "session": "session0", |
| 698 | "document": { |
| 699 | "_id": 1 |
| 700 | } |
| 701 | }, |
| 702 | "result": { |
| 703 | "insertedId": 1 |
| 704 | } |
| 705 | }, |
| 706 | { |
| 707 | "name": "commitTransaction", |
| 708 | "object": "session0" |
| 709 | }, |
| 710 | { |
| 711 | "name": "insertOne", |
| 712 | "object": "collection", |
| 713 | "arguments": { |
| 714 | "session": "session0", |
| 715 | "document": { |
| 716 | "_id": 2 |
| 717 | } |
| 718 | }, |
| 719 | "result": { |
| 720 | "insertedId": 2 |
| 721 | } |
| 722 | }, |
| 723 | { |
| 724 | "name": "commitTransaction", |
| 725 | "object": "session0", |
| 726 | "result": { |
| 727 | "errorContains": "no transaction started" |
| 728 | } |
| 729 | } |
| 730 | ], |
| 731 | "expectations": [ |
| 732 | { |
| 733 | "command_started_event": { |
| 734 | "command": { |
| 735 | "insert": "test", |
| 736 | "documents": [ |
| 737 | { |
| 738 | "_id": 1 |
| 739 | } |
| 740 | ], |
| 741 | "ordered": true, |
| 742 | "readConcern": null, |
| 743 | "lsid": "session0", |
| 744 | "txnNumber": { |
| 745 | "$numberLong": "1" |
| 746 | }, |
| 747 | "startTransaction": true, |
| 748 | "autocommit": false, |
| 749 | "writeConcern": null |
| 750 | }, |
| 751 | "command_name": "insert", |
| 752 | "database_name": "transaction-tests" |
| 753 | } |
| 754 | }, |
| 755 | { |
| 756 | "command_started_event": { |
| 757 | "command": { |
| 758 | "commitTransaction": 1, |
| 759 | "lsid": "session0", |
| 760 | "txnNumber": { |
| 761 | "$numberLong": "1" |
| 762 | }, |
| 763 | "startTransaction": null, |
| 764 | "autocommit": false, |
| 765 | "writeConcern": null |
| 766 | }, |
| 767 | "command_name": "commitTransaction", |
| 768 | "database_name": "admin" |
| 769 | } |
| 770 | }, |
| 771 | { |
| 772 | "command_started_event": { |
| 773 | "command": { |
| 774 | "insert": "test", |
| 775 | "documents": [ |
| 776 | { |
| 777 | "_id": 2 |
| 778 | } |
| 779 | ], |
| 780 | "ordered": true, |
| 781 | "readConcern": null, |
| 782 | "lsid": "session0", |
| 783 | "txnNumber": null, |
| 784 | "startTransaction": null, |
| 785 | "autocommit": null |
| 786 | }, |
| 787 | "command_name": "insert", |
| 788 | "database_name": "transaction-tests" |
| 789 | } |
| 790 | } |
| 791 | ], |
| 792 | "outcome": { |
| 793 | "collection": { |
| 794 | "data": [ |
| 795 | { |
| 796 | "_id": 1 |
| 797 | }, |
| 798 | { |
| 799 | "_id": 2 |
| 800 | } |
| 801 | ] |
| 802 | } |
| 803 | } |
| 804 | }, |
| 805 | { |
| 806 | "description": "reset session state abort", |
| 807 | "clientOptions": { |
| 808 | "retryWrites": false |
| 809 | }, |
| 810 | "operations": [ |
| 811 | { |
| 812 | "name": "startTransaction", |
| 813 | "object": "session0" |
| 814 | }, |
| 815 | { |
| 816 | "name": "insertOne", |
| 817 | "object": "collection", |
| 818 | "arguments": { |
| 819 | "session": "session0", |
| 820 | "document": { |
| 821 | "_id": 1 |
| 822 | } |
| 823 | }, |
| 824 | "result": { |
| 825 | "insertedId": 1 |
| 826 | } |
| 827 | }, |
| 828 | { |
| 829 | "name": "abortTransaction", |
| 830 | "object": "session0" |
| 831 | }, |
| 832 | { |
| 833 | "name": "insertOne", |
| 834 | "object": "collection", |
| 835 | "arguments": { |
| 836 | "session": "session0", |
| 837 | "document": { |
| 838 | "_id": 2 |
| 839 | } |
| 840 | }, |
| 841 | "result": { |
| 842 | "insertedId": 2 |
| 843 | } |
| 844 | }, |
| 845 | { |
| 846 | "name": "abortTransaction", |
| 847 | "object": "session0", |
| 848 | "result": { |
| 849 | "errorContains": "no transaction started" |
| 850 | } |
| 851 | } |
| 852 | ], |
| 853 | "expectations": [ |
| 854 | { |
| 855 | "command_started_event": { |
| 856 | "command": { |
| 857 | "insert": "test", |
| 858 | "documents": [ |
| 859 | { |
| 860 | "_id": 1 |
| 861 | } |
| 862 | ], |
| 863 | "ordered": true, |
| 864 | "readConcern": null, |
| 865 | "lsid": "session0", |
| 866 | "txnNumber": { |
| 867 | "$numberLong": "1" |
| 868 | }, |
| 869 | "startTransaction": true, |
| 870 | "autocommit": false, |
| 871 | "writeConcern": null |
| 872 | }, |
| 873 | "command_name": "insert", |
| 874 | "database_name": "transaction-tests" |
| 875 | } |
| 876 | }, |
| 877 | { |
| 878 | "command_started_event": { |
| 879 | "command": { |
| 880 | "abortTransaction": 1, |
| 881 | "lsid": "session0", |
| 882 | "txnNumber": { |
| 883 | "$numberLong": "1" |
| 884 | }, |
| 885 | "startTransaction": null, |
| 886 | "autocommit": false, |
| 887 | "writeConcern": null |
| 888 | }, |
| 889 | "command_name": "abortTransaction", |
| 890 | "database_name": "admin" |
| 891 | } |
| 892 | }, |
| 893 | { |
| 894 | "command_started_event": { |
| 895 | "command": { |
| 896 | "insert": "test", |
| 897 | "documents": [ |
| 898 | { |
| 899 | "_id": 2 |
| 900 | } |
| 901 | ], |
| 902 | "ordered": true, |
| 903 | "readConcern": null, |
| 904 | "lsid": "session0", |
| 905 | "txnNumber": null, |
| 906 | "startTransaction": null, |
| 907 | "autocommit": null |
| 908 | }, |
| 909 | "command_name": "insert", |
| 910 | "database_name": "transaction-tests" |
| 911 | } |
| 912 | } |
| 913 | ], |
| 914 | "outcome": { |
| 915 | "collection": { |
| 916 | "data": [ |
| 917 | { |
| 918 | "_id": 2 |
| 919 | } |
| 920 | ] |
| 921 | } |
| 922 | } |
| 923 | } |
| 924 | ] |
| 925 | } |