| 1 | { |
| 2 | "description": "cursors are correctly pinned to connections for load-balanced clusters", |
| 3 | "schemaVersion": "1.3", |
| 4 | "runOnRequirements": [ |
| 5 | { |
| 6 | "topologies": [ |
| 7 | "load-balanced" |
| 8 | ] |
| 9 | } |
| 10 | ], |
| 11 | "createEntities": [ |
| 12 | { |
| 13 | "client": { |
| 14 | "id": "client0", |
| 15 | "useMultipleMongoses": true, |
| 16 | "observeEvents": [ |
| 17 | "commandStartedEvent", |
| 18 | "commandSucceededEvent", |
| 19 | "commandFailedEvent", |
| 20 | "connectionReadyEvent", |
| 21 | "connectionClosedEvent", |
| 22 | "connectionCheckedOutEvent", |
| 23 | "connectionCheckedInEvent" |
| 24 | ] |
| 25 | } |
| 26 | }, |
| 27 | { |
| 28 | "database": { |
| 29 | "id": "database0", |
| 30 | "client": "client0", |
| 31 | "databaseName": "database0Name" |
| 32 | } |
| 33 | }, |
| 34 | { |
| 35 | "collection": { |
| 36 | "id": "collection0", |
| 37 | "database": "database0", |
| 38 | "collectionName": "coll0" |
| 39 | } |
| 40 | }, |
| 41 | { |
| 42 | "collection": { |
| 43 | "id": "collection1", |
| 44 | "database": "database0", |
| 45 | "collectionName": "coll1" |
| 46 | } |
| 47 | }, |
| 48 | { |
| 49 | "collection": { |
| 50 | "id": "collection2", |
| 51 | "database": "database0", |
| 52 | "collectionName": "coll2" |
| 53 | } |
| 54 | } |
| 55 | ], |
| 56 | "initialData": [ |
| 57 | { |
| 58 | "collectionName": "coll0", |
| 59 | "databaseName": "database0Name", |
| 60 | "documents": [ |
| 61 | { |
| 62 | "_id": 1 |
| 63 | }, |
| 64 | { |
| 65 | "_id": 2 |
| 66 | }, |
| 67 | { |
| 68 | "_id": 3 |
| 69 | } |
| 70 | ] |
| 71 | }, |
| 72 | { |
| 73 | "collectionName": "coll1", |
| 74 | "databaseName": "database0Name", |
| 75 | "documents": [] |
| 76 | }, |
| 77 | { |
| 78 | "collectionName": "coll2", |
| 79 | "databaseName": "database0Name", |
| 80 | "documents": [] |
| 81 | } |
| 82 | ], |
| 83 | "tests": [ |
| 84 | { |
| 85 | "description": "no connection is pinned if all documents are returned in the initial batch", |
| 86 | "operations": [ |
| 87 | { |
| 88 | "name": "createFindCursor", |
| 89 | "object": "collection0", |
| 90 | "arguments": { |
| 91 | "filter": {} |
| 92 | }, |
| 93 | "saveResultAsEntity": "cursor0" |
| 94 | }, |
| 95 | { |
| 96 | "name": "assertNumberConnectionsCheckedOut", |
| 97 | "object": "testRunner", |
| 98 | "arguments": { |
| 99 | "client": "client0", |
| 100 | "connections": 0 |
| 101 | } |
| 102 | } |
| 103 | ], |
| 104 | "expectEvents": [ |
| 105 | { |
| 106 | "client": "client0", |
| 107 | "events": [ |
| 108 | { |
| 109 | "commandStartedEvent": { |
| 110 | "command": { |
| 111 | "find": "coll0", |
| 112 | "filter": {} |
| 113 | }, |
| 114 | "commandName": "find" |
| 115 | } |
| 116 | }, |
| 117 | { |
| 118 | "commandSucceededEvent": { |
| 119 | "reply": { |
| 120 | "cursor": { |
| 121 | "id": 0, |
| 122 | "firstBatch": { |
| 123 | "$$type": "array" |
| 124 | }, |
| 125 | "ns": { |
| 126 | "$$type": "string" |
| 127 | } |
| 128 | } |
| 129 | }, |
| 130 | "commandName": "find" |
| 131 | } |
| 132 | } |
| 133 | ] |
| 134 | }, |
| 135 | { |
| 136 | "client": "client0", |
| 137 | "eventType": "cmap", |
| 138 | "events": [ |
| 139 | { |
| 140 | "connectionReadyEvent": {} |
| 141 | }, |
| 142 | { |
| 143 | "connectionCheckedOutEvent": {} |
| 144 | }, |
| 145 | { |
| 146 | "connectionCheckedInEvent": {} |
| 147 | } |
| 148 | ] |
| 149 | } |
| 150 | ] |
| 151 | }, |
| 152 | { |
| 153 | "description": "pinned connections are returned when the cursor is drained", |
| 154 | "operations": [ |
| 155 | { |
| 156 | "name": "createFindCursor", |
| 157 | "object": "collection0", |
| 158 | "arguments": { |
| 159 | "filter": {}, |
| 160 | "batchSize": 2 |
| 161 | }, |
| 162 | "saveResultAsEntity": "cursor0" |
| 163 | }, |
| 164 | { |
| 165 | "name": "assertNumberConnectionsCheckedOut", |
| 166 | "object": "testRunner", |
| 167 | "arguments": { |
| 168 | "client": "client0", |
| 169 | "connections": 1 |
| 170 | } |
| 171 | }, |
| 172 | { |
| 173 | "name": "iterateUntilDocumentOrError", |
| 174 | "object": "cursor0", |
| 175 | "expectResult": { |
| 176 | "_id": 1 |
| 177 | } |
| 178 | }, |
| 179 | { |
| 180 | "name": "iterateUntilDocumentOrError", |
| 181 | "object": "cursor0", |
| 182 | "expectResult": { |
| 183 | "_id": 2 |
| 184 | } |
| 185 | }, |
| 186 | { |
| 187 | "name": "iterateUntilDocumentOrError", |
| 188 | "object": "cursor0", |
| 189 | "expectResult": { |
| 190 | "_id": 3 |
| 191 | } |
| 192 | }, |
| 193 | { |
| 194 | "name": "assertNumberConnectionsCheckedOut", |
| 195 | "object": "testRunner", |
| 196 | "arguments": { |
| 197 | "client": "client0", |
| 198 | "connections": 0 |
| 199 | } |
| 200 | }, |
| 201 | { |
| 202 | "name": "close", |
| 203 | "object": "cursor0" |
| 204 | } |
| 205 | ], |
| 206 | "expectEvents": [ |
| 207 | { |
| 208 | "client": "client0", |
| 209 | "events": [ |
| 210 | { |
| 211 | "commandStartedEvent": { |
| 212 | "command": { |
| 213 | "find": "coll0", |
| 214 | "filter": {}, |
| 215 | "batchSize": 2 |
| 216 | }, |
| 217 | "commandName": "find" |
| 218 | } |
| 219 | }, |
| 220 | { |
| 221 | "commandSucceededEvent": { |
| 222 | "reply": { |
| 223 | "cursor": { |
| 224 | "id": { |
| 225 | "$$type": "long" |
| 226 | }, |
| 227 | "firstBatch": { |
| 228 | "$$type": "array" |
| 229 | }, |
| 230 | "ns": { |
| 231 | "$$type": "string" |
| 232 | } |
| 233 | } |
| 234 | }, |
| 235 | "commandName": "find" |
| 236 | } |
| 237 | }, |
| 238 | { |
| 239 | "commandStartedEvent": { |
| 240 | "command": { |
| 241 | "getMore": { |
| 242 | "$$type": "long" |
| 243 | }, |
| 244 | "collection": "coll0" |
| 245 | }, |
| 246 | "commandName": "getMore" |
| 247 | } |
| 248 | }, |
| 249 | { |
| 250 | "commandSucceededEvent": { |
| 251 | "reply": { |
| 252 | "cursor": { |
| 253 | "id": 0, |
| 254 | "ns": { |
| 255 | "$$type": "string" |
| 256 | }, |
| 257 | "nextBatch": { |
| 258 | "$$type": "array" |
| 259 | } |
| 260 | } |
| 261 | }, |
| 262 | "commandName": "getMore" |
| 263 | } |
| 264 | } |
| 265 | ] |
| 266 | }, |
| 267 | { |
| 268 | "client": "client0", |
| 269 | "eventType": "cmap", |
| 270 | "events": [ |
| 271 | { |
| 272 | "connectionReadyEvent": {} |
| 273 | }, |
| 274 | { |
| 275 | "connectionCheckedOutEvent": {} |
| 276 | }, |
| 277 | { |
| 278 | "connectionCheckedInEvent": {} |
| 279 | } |
| 280 | ] |
| 281 | } |
| 282 | ] |
| 283 | }, |
| 284 | { |
| 285 | "description": "pinned connections are returned to the pool when the cursor is closed", |
| 286 | "operations": [ |
| 287 | { |
| 288 | "name": "createFindCursor", |
| 289 | "object": "collection0", |
| 290 | "arguments": { |
| 291 | "filter": {}, |
| 292 | "batchSize": 2 |
| 293 | }, |
| 294 | "saveResultAsEntity": "cursor0" |
| 295 | }, |
| 296 | { |
| 297 | "name": "assertNumberConnectionsCheckedOut", |
| 298 | "object": "testRunner", |
| 299 | "arguments": { |
| 300 | "client": "client0", |
| 301 | "connections": 1 |
| 302 | } |
| 303 | }, |
| 304 | { |
| 305 | "name": "close", |
| 306 | "object": "cursor0" |
| 307 | }, |
| 308 | { |
| 309 | "name": "assertNumberConnectionsCheckedOut", |
| 310 | "object": "testRunner", |
| 311 | "arguments": { |
| 312 | "client": "client0", |
| 313 | "connections": 0 |
| 314 | } |
| 315 | } |
| 316 | ], |
| 317 | "expectEvents": [ |
| 318 | { |
| 319 | "client": "client0", |
| 320 | "events": [ |
| 321 | { |
| 322 | "commandStartedEvent": { |
| 323 | "command": { |
| 324 | "find": "coll0", |
| 325 | "filter": {}, |
| 326 | "batchSize": 2 |
| 327 | }, |
| 328 | "commandName": "find" |
| 329 | } |
| 330 | }, |
| 331 | { |
| 332 | "commandSucceededEvent": { |
| 333 | "reply": { |
| 334 | "cursor": { |
| 335 | "id": { |
| 336 | "$$type": "long" |
| 337 | }, |
| 338 | "firstBatch": { |
| 339 | "$$type": "array" |
| 340 | }, |
| 341 | "ns": { |
| 342 | "$$type": "string" |
| 343 | } |
| 344 | } |
| 345 | }, |
| 346 | "commandName": "find" |
| 347 | } |
| 348 | }, |
| 349 | { |
| 350 | "commandStartedEvent": { |
| 351 | "commandName": "killCursors" |
| 352 | } |
| 353 | }, |
| 354 | { |
| 355 | "commandSucceededEvent": { |
| 356 | "commandName": "killCursors" |
| 357 | } |
| 358 | } |
| 359 | ] |
| 360 | }, |
| 361 | { |
| 362 | "client": "client0", |
| 363 | "eventType": "cmap", |
| 364 | "events": [ |
| 365 | { |
| 366 | "connectionReadyEvent": {} |
| 367 | }, |
| 368 | { |
| 369 | "connectionCheckedOutEvent": {} |
| 370 | }, |
| 371 | { |
| 372 | "connectionCheckedInEvent": {} |
| 373 | } |
| 374 | ] |
| 375 | } |
| 376 | ] |
| 377 | }, |
| 378 | { |
| 379 | "description": "pinned connections are not returned after an network error during getMore", |
| 380 | "operations": [ |
| 381 | { |
| 382 | "name": "failPoint", |
| 383 | "object": "testRunner", |
| 384 | "arguments": { |
| 385 | "client": "client0", |
| 386 | "failPoint": { |
| 387 | "configureFailPoint": "failCommand", |
| 388 | "mode": { |
| 389 | "times": 1 |
| 390 | }, |
| 391 | "data": { |
| 392 | "failCommands": [ |
| 393 | "getMore" |
| 394 | ], |
| 395 | "closeConnection": true |
| 396 | } |
| 397 | } |
| 398 | } |
| 399 | }, |
| 400 | { |
| 401 | "name": "createFindCursor", |
| 402 | "object": "collection0", |
| 403 | "arguments": { |
| 404 | "filter": {}, |
| 405 | "batchSize": 2 |
| 406 | }, |
| 407 | "saveResultAsEntity": "cursor0" |
| 408 | }, |
| 409 | { |
| 410 | "name": "assertNumberConnectionsCheckedOut", |
| 411 | "object": "testRunner", |
| 412 | "arguments": { |
| 413 | "client": "client0", |
| 414 | "connections": 1 |
| 415 | } |
| 416 | }, |
| 417 | { |
| 418 | "name": "iterateUntilDocumentOrError", |
| 419 | "object": "cursor0", |
| 420 | "expectResult": { |
| 421 | "_id": 1 |
| 422 | } |
| 423 | }, |
| 424 | { |
| 425 | "name": "iterateUntilDocumentOrError", |
| 426 | "object": "cursor0", |
| 427 | "expectResult": { |
| 428 | "_id": 2 |
| 429 | } |
| 430 | }, |
| 431 | { |
| 432 | "name": "iterateUntilDocumentOrError", |
| 433 | "object": "cursor0", |
| 434 | "expectError": { |
| 435 | "isClientError": true |
| 436 | } |
| 437 | }, |
| 438 | { |
| 439 | "name": "assertNumberConnectionsCheckedOut", |
| 440 | "object": "testRunner", |
| 441 | "arguments": { |
| 442 | "client": "client0", |
| 443 | "connections": 1 |
| 444 | } |
| 445 | }, |
| 446 | { |
| 447 | "name": "close", |
| 448 | "object": "cursor0" |
| 449 | }, |
| 450 | { |
| 451 | "name": "assertNumberConnectionsCheckedOut", |
| 452 | "object": "testRunner", |
| 453 | "arguments": { |
| 454 | "client": "client0", |
| 455 | "connections": 0 |
| 456 | } |
| 457 | } |
| 458 | ], |
| 459 | "expectEvents": [ |
| 460 | { |
| 461 | "client": "client0", |
| 462 | "events": [ |
| 463 | { |
| 464 | "commandStartedEvent": { |
| 465 | "command": { |
| 466 | "find": "coll0", |
| 467 | "filter": {}, |
| 468 | "batchSize": 2 |
| 469 | }, |
| 470 | "commandName": "find" |
| 471 | } |
| 472 | }, |
| 473 | { |
| 474 | "commandSucceededEvent": { |
| 475 | "reply": { |
| 476 | "cursor": { |
| 477 | "id": { |
| 478 | "$$type": "long" |
| 479 | }, |
| 480 | "firstBatch": { |
| 481 | "$$type": "array" |
| 482 | }, |
| 483 | "ns": { |
| 484 | "$$type": "string" |
| 485 | } |
| 486 | } |
| 487 | }, |
| 488 | "commandName": "find" |
| 489 | } |
| 490 | }, |
| 491 | { |
| 492 | "commandStartedEvent": { |
| 493 | "command": { |
| 494 | "getMore": { |
| 495 | "$$type": "long" |
| 496 | }, |
| 497 | "collection": "coll0" |
| 498 | }, |
| 499 | "commandName": "getMore" |
| 500 | } |
| 501 | }, |
| 502 | { |
| 503 | "commandFailedEvent": { |
| 504 | "commandName": "getMore" |
| 505 | } |
| 506 | } |
| 507 | ] |
| 508 | }, |
| 509 | { |
| 510 | "client": "client0", |
| 511 | "eventType": "cmap", |
| 512 | "events": [ |
| 513 | { |
| 514 | "connectionReadyEvent": {} |
| 515 | }, |
| 516 | { |
| 517 | "connectionCheckedOutEvent": {} |
| 518 | }, |
| 519 | { |
| 520 | "connectionCheckedInEvent": {} |
| 521 | }, |
| 522 | { |
| 523 | "connectionCheckedOutEvent": {} |
| 524 | }, |
| 525 | { |
| 526 | "connectionCheckedInEvent": {} |
| 527 | }, |
| 528 | { |
| 529 | "connectionClosedEvent": { |
| 530 | "reason": "error" |
| 531 | } |
| 532 | } |
| 533 | ] |
| 534 | } |
| 535 | ] |
| 536 | }, |
| 537 | { |
| 538 | "description": "pinned connections are returned after a network error during a killCursors request", |
| 539 | "operations": [ |
| 540 | { |
| 541 | "name": "failPoint", |
| 542 | "object": "testRunner", |
| 543 | "arguments": { |
| 544 | "client": "client0", |
| 545 | "failPoint": { |
| 546 | "configureFailPoint": "failCommand", |
| 547 | "mode": { |
| 548 | "times": 1 |
| 549 | }, |
| 550 | "data": { |
| 551 | "failCommands": [ |
| 552 | "killCursors" |
| 553 | ], |
| 554 | "closeConnection": true |
| 555 | } |
| 556 | } |
| 557 | } |
| 558 | }, |
| 559 | { |
| 560 | "name": "createFindCursor", |
| 561 | "object": "collection0", |
| 562 | "arguments": { |
| 563 | "filter": {}, |
| 564 | "batchSize": 2 |
| 565 | }, |
| 566 | "saveResultAsEntity": "cursor0" |
| 567 | }, |
| 568 | { |
| 569 | "name": "assertNumberConnectionsCheckedOut", |
| 570 | "object": "testRunner", |
| 571 | "arguments": { |
| 572 | "client": "client0", |
| 573 | "connections": 1 |
| 574 | } |
| 575 | }, |
| 576 | { |
| 577 | "name": "close", |
| 578 | "object": "cursor0" |
| 579 | }, |
| 580 | { |
| 581 | "name": "assertNumberConnectionsCheckedOut", |
| 582 | "object": "testRunner", |
| 583 | "arguments": { |
| 584 | "client": "client0", |
| 585 | "connections": 0 |
| 586 | } |
| 587 | } |
| 588 | ], |
| 589 | "expectEvents": [ |
| 590 | { |
| 591 | "client": "client0", |
| 592 | "events": [ |
| 593 | { |
| 594 | "commandStartedEvent": { |
| 595 | "command": { |
| 596 | "find": "coll0", |
| 597 | "filter": {}, |
| 598 | "batchSize": 2 |
| 599 | }, |
| 600 | "commandName": "find" |
| 601 | } |
| 602 | }, |
| 603 | { |
| 604 | "commandSucceededEvent": { |
| 605 | "reply": { |
| 606 | "cursor": { |
| 607 | "id": { |
| 608 | "$$type": "long" |
| 609 | }, |
| 610 | "firstBatch": { |
| 611 | "$$type": "array" |
| 612 | }, |
| 613 | "ns": { |
| 614 | "$$type": "string" |
| 615 | } |
| 616 | } |
| 617 | }, |
| 618 | "commandName": "find" |
| 619 | } |
| 620 | }, |
| 621 | { |
| 622 | "commandStartedEvent": { |
| 623 | "commandName": "killCursors" |
| 624 | } |
| 625 | }, |
| 626 | { |
| 627 | "commandFailedEvent": { |
| 628 | "commandName": "killCursors" |
| 629 | } |
| 630 | } |
| 631 | ] |
| 632 | }, |
| 633 | { |
| 634 | "client": "client0", |
| 635 | "eventType": "cmap", |
| 636 | "events": [ |
| 637 | { |
| 638 | "connectionReadyEvent": {} |
| 639 | }, |
| 640 | { |
| 641 | "connectionCheckedOutEvent": {} |
| 642 | }, |
| 643 | { |
| 644 | "connectionCheckedInEvent": {} |
| 645 | }, |
| 646 | { |
| 647 | "connectionCheckedOutEvent": {} |
| 648 | }, |
| 649 | { |
| 650 | "connectionCheckedInEvent": {} |
| 651 | }, |
| 652 | { |
| 653 | "connectionClosedEvent": { |
| 654 | "reason": "error" |
| 655 | } |
| 656 | } |
| 657 | ] |
| 658 | } |
| 659 | ] |
| 660 | }, |
| 661 | { |
| 662 | "description": "pinned connections are not returned to the pool after a non-network error on getMore", |
| 663 | "operations": [ |
| 664 | { |
| 665 | "name": "failPoint", |
| 666 | "object": "testRunner", |
| 667 | "arguments": { |
| 668 | "client": "client0", |
| 669 | "failPoint": { |
| 670 | "configureFailPoint": "failCommand", |
| 671 | "mode": { |
| 672 | "times": 1 |
| 673 | }, |
| 674 | "data": { |
| 675 | "failCommands": [ |
| 676 | "getMore" |
| 677 | ], |
| 678 | "errorCode": 7 |
| 679 | } |
| 680 | } |
| 681 | } |
| 682 | }, |
| 683 | { |
| 684 | "name": "createFindCursor", |
| 685 | "object": "collection0", |
| 686 | "arguments": { |
| 687 | "filter": {}, |
| 688 | "batchSize": 2 |
| 689 | }, |
| 690 | "saveResultAsEntity": "cursor0" |
| 691 | }, |
| 692 | { |
| 693 | "name": "iterateUntilDocumentOrError", |
| 694 | "object": "cursor0", |
| 695 | "expectResult": { |
| 696 | "_id": 1 |
| 697 | } |
| 698 | }, |
| 699 | { |
| 700 | "name": "iterateUntilDocumentOrError", |
| 701 | "object": "cursor0", |
| 702 | "expectResult": { |
| 703 | "_id": 2 |
| 704 | } |
| 705 | }, |
| 706 | { |
| 707 | "name": "iterateUntilDocumentOrError", |
| 708 | "object": "cursor0", |
| 709 | "expectError": { |
| 710 | "errorCode": 7 |
| 711 | } |
| 712 | }, |
| 713 | { |
| 714 | "name": "assertNumberConnectionsCheckedOut", |
| 715 | "object": "testRunner", |
| 716 | "arguments": { |
| 717 | "client": "client0", |
| 718 | "connections": 1 |
| 719 | } |
| 720 | }, |
| 721 | { |
| 722 | "name": "close", |
| 723 | "object": "cursor0" |
| 724 | }, |
| 725 | { |
| 726 | "name": "assertNumberConnectionsCheckedOut", |
| 727 | "object": "testRunner", |
| 728 | "arguments": { |
| 729 | "client": "client0", |
| 730 | "connections": 0 |
| 731 | } |
| 732 | } |
| 733 | ], |
| 734 | "expectEvents": [ |
| 735 | { |
| 736 | "client": "client0", |
| 737 | "events": [ |
| 738 | { |
| 739 | "commandStartedEvent": { |
| 740 | "command": { |
| 741 | "find": "coll0", |
| 742 | "filter": {}, |
| 743 | "batchSize": 2 |
| 744 | }, |
| 745 | "commandName": "find" |
| 746 | } |
| 747 | }, |
| 748 | { |
| 749 | "commandSucceededEvent": { |
| 750 | "reply": { |
| 751 | "cursor": { |
| 752 | "id": { |
| 753 | "$$type": "long" |
| 754 | }, |
| 755 | "firstBatch": { |
| 756 | "$$type": "array" |
| 757 | }, |
| 758 | "ns": { |
| 759 | "$$type": "string" |
| 760 | } |
| 761 | } |
| 762 | }, |
| 763 | "commandName": "find" |
| 764 | } |
| 765 | }, |
| 766 | { |
| 767 | "commandStartedEvent": { |
| 768 | "command": { |
| 769 | "getMore": { |
| 770 | "$$type": "long" |
| 771 | }, |
| 772 | "collection": "coll0" |
| 773 | }, |
| 774 | "commandName": "getMore" |
| 775 | } |
| 776 | }, |
| 777 | { |
| 778 | "commandFailedEvent": { |
| 779 | "commandName": "getMore" |
| 780 | } |
| 781 | }, |
| 782 | { |
| 783 | "commandStartedEvent": { |
| 784 | "commandName": "killCursors" |
| 785 | } |
| 786 | }, |
| 787 | { |
| 788 | "commandSucceededEvent": { |
| 789 | "commandName": "killCursors" |
| 790 | } |
| 791 | } |
| 792 | ] |
| 793 | }, |
| 794 | { |
| 795 | "client": "client0", |
| 796 | "eventType": "cmap", |
| 797 | "events": [ |
| 798 | { |
| 799 | "connectionReadyEvent": {} |
| 800 | }, |
| 801 | { |
| 802 | "connectionCheckedOutEvent": {} |
| 803 | }, |
| 804 | { |
| 805 | "connectionCheckedInEvent": {} |
| 806 | }, |
| 807 | { |
| 808 | "connectionCheckedOutEvent": {} |
| 809 | }, |
| 810 | { |
| 811 | "connectionCheckedInEvent": {} |
| 812 | } |
| 813 | ] |
| 814 | } |
| 815 | ] |
| 816 | }, |
| 817 | { |
| 818 | "description": "aggregate pins the cursor to a connection", |
| 819 | "operations": [ |
| 820 | { |
| 821 | "name": "aggregate", |
| 822 | "object": "collection0", |
| 823 | "arguments": { |
| 824 | "pipeline": [], |
| 825 | "batchSize": 2 |
| 826 | } |
| 827 | }, |
| 828 | { |
| 829 | "name": "assertNumberConnectionsCheckedOut", |
| 830 | "object": "testRunner", |
| 831 | "arguments": { |
| 832 | "client": "client0", |
| 833 | "connections": 0 |
| 834 | } |
| 835 | } |
| 836 | ], |
| 837 | "expectEvents": [ |
| 838 | { |
| 839 | "client": "client0", |
| 840 | "events": [ |
| 841 | { |
| 842 | "commandStartedEvent": { |
| 843 | "command": { |
| 844 | "aggregate": "coll0", |
| 845 | "cursor": { |
| 846 | "batchSize": 2 |
| 847 | } |
| 848 | }, |
| 849 | "commandName": "aggregate" |
| 850 | } |
| 851 | }, |
| 852 | { |
| 853 | "commandSucceededEvent": { |
| 854 | "commandName": "aggregate" |
| 855 | } |
| 856 | }, |
| 857 | { |
| 858 | "commandStartedEvent": { |
| 859 | "command": { |
| 860 | "getMore": { |
| 861 | "$$type": "long" |
| 862 | }, |
| 863 | "collection": "coll0" |
| 864 | }, |
| 865 | "commandName": "getMore" |
| 866 | } |
| 867 | }, |
| 868 | { |
| 869 | "commandSucceededEvent": { |
| 870 | "reply": { |
| 871 | "cursor": { |
| 872 | "id": 0, |
| 873 | "ns": { |
| 874 | "$$type": "string" |
| 875 | }, |
| 876 | "nextBatch": { |
| 877 | "$$type": "array" |
| 878 | } |
| 879 | } |
| 880 | }, |
| 881 | "commandName": "getMore" |
| 882 | } |
| 883 | } |
| 884 | ] |
| 885 | }, |
| 886 | { |
| 887 | "client": "client0", |
| 888 | "eventType": "cmap", |
| 889 | "events": [ |
| 890 | { |
| 891 | "connectionReadyEvent": {} |
| 892 | }, |
| 893 | { |
| 894 | "connectionCheckedOutEvent": {} |
| 895 | }, |
| 896 | { |
| 897 | "connectionCheckedInEvent": {} |
| 898 | } |
| 899 | ] |
| 900 | } |
| 901 | ] |
| 902 | }, |
| 903 | { |
| 904 | "description": "listCollections pins the cursor to a connection", |
| 905 | "runOnRequirements": [ |
| 906 | { |
| 907 | "serverless": "forbid" |
| 908 | } |
| 909 | ], |
| 910 | "operations": [ |
| 911 | { |
| 912 | "name": "listCollections", |
| 913 | "object": "database0", |
| 914 | "arguments": { |
| 915 | "filter": {}, |
| 916 | "batchSize": 2 |
| 917 | } |
| 918 | }, |
| 919 | { |
| 920 | "name": "assertNumberConnectionsCheckedOut", |
| 921 | "object": "testRunner", |
| 922 | "arguments": { |
| 923 | "client": "client0", |
| 924 | "connections": 0 |
| 925 | } |
| 926 | } |
| 927 | ], |
| 928 | "expectEvents": [ |
| 929 | { |
| 930 | "client": "client0", |
| 931 | "events": [ |
| 932 | { |
| 933 | "commandStartedEvent": { |
| 934 | "command": { |
| 935 | "listCollections": 1, |
| 936 | "cursor": { |
| 937 | "batchSize": 2 |
| 938 | } |
| 939 | }, |
| 940 | "commandName": "listCollections", |
| 941 | "databaseName": "database0Name" |
| 942 | } |
| 943 | }, |
| 944 | { |
| 945 | "commandSucceededEvent": { |
| 946 | "commandName": "listCollections" |
| 947 | } |
| 948 | }, |
| 949 | { |
| 950 | "commandStartedEvent": { |
| 951 | "command": { |
| 952 | "getMore": { |
| 953 | "$$type": "long" |
| 954 | }, |
| 955 | "collection": { |
| 956 | "$$type": "string" |
| 957 | } |
| 958 | }, |
| 959 | "commandName": "getMore" |
| 960 | } |
| 961 | }, |
| 962 | { |
| 963 | "commandSucceededEvent": { |
| 964 | "reply": { |
| 965 | "cursor": { |
| 966 | "id": 0, |
| 967 | "ns": { |
| 968 | "$$type": "string" |
| 969 | }, |
| 970 | "nextBatch": { |
| 971 | "$$type": "array" |
| 972 | } |
| 973 | } |
| 974 | }, |
| 975 | "commandName": "getMore" |
| 976 | } |
| 977 | } |
| 978 | ] |
| 979 | }, |
| 980 | { |
| 981 | "client": "client0", |
| 982 | "eventType": "cmap", |
| 983 | "events": [ |
| 984 | { |
| 985 | "connectionReadyEvent": {} |
| 986 | }, |
| 987 | { |
| 988 | "connectionCheckedOutEvent": {} |
| 989 | }, |
| 990 | { |
| 991 | "connectionCheckedInEvent": {} |
| 992 | } |
| 993 | ] |
| 994 | } |
| 995 | ] |
| 996 | }, |
| 997 | { |
| 998 | "description": "listIndexes pins the cursor to a connection", |
| 999 | "operations": [ |
| 1000 | { |
| 1001 | "name": "createIndex", |
| 1002 | "object": "collection0", |
| 1003 | "arguments": { |
| 1004 | "keys": { |
| 1005 | "x": 1 |
| 1006 | }, |
| 1007 | "name": "x_1" |
| 1008 | } |
| 1009 | }, |
| 1010 | { |
| 1011 | "name": "createIndex", |
| 1012 | "object": "collection0", |
| 1013 | "arguments": { |
| 1014 | "keys": { |
| 1015 | "y": 1 |
| 1016 | }, |
| 1017 | "name": "y_1" |
| 1018 | } |
| 1019 | }, |
| 1020 | { |
| 1021 | "name": "listIndexes", |
| 1022 | "object": "collection0", |
| 1023 | "arguments": { |
| 1024 | "batchSize": 2 |
| 1025 | } |
| 1026 | }, |
| 1027 | { |
| 1028 | "name": "assertNumberConnectionsCheckedOut", |
| 1029 | "object": "testRunner", |
| 1030 | "arguments": { |
| 1031 | "client": "client0", |
| 1032 | "connections": 0 |
| 1033 | } |
| 1034 | } |
| 1035 | ], |
| 1036 | "expectEvents": [ |
| 1037 | { |
| 1038 | "client": "client0", |
| 1039 | "events": [ |
| 1040 | { |
| 1041 | "commandStartedEvent": { |
| 1042 | "command": { |
| 1043 | "createIndexes": "coll0", |
| 1044 | "indexes": [ |
| 1045 | { |
| 1046 | "name": "x_1", |
| 1047 | "key": { |
| 1048 | "x": 1 |
| 1049 | } |
| 1050 | } |
| 1051 | ] |
| 1052 | }, |
| 1053 | "commandName": "createIndexes" |
| 1054 | } |
| 1055 | }, |
| 1056 | { |
| 1057 | "commandSucceededEvent": { |
| 1058 | "commandName": "createIndexes" |
| 1059 | } |
| 1060 | }, |
| 1061 | { |
| 1062 | "commandStartedEvent": { |
| 1063 | "command": { |
| 1064 | "createIndexes": "coll0", |
| 1065 | "indexes": [ |
| 1066 | { |
| 1067 | "name": "y_1", |
| 1068 | "key": { |
| 1069 | "y": 1 |
| 1070 | } |
| 1071 | } |
| 1072 | ] |
| 1073 | }, |
| 1074 | "commandName": "createIndexes" |
| 1075 | } |
| 1076 | }, |
| 1077 | { |
| 1078 | "commandSucceededEvent": { |
| 1079 | "commandName": "createIndexes" |
| 1080 | } |
| 1081 | }, |
| 1082 | { |
| 1083 | "commandStartedEvent": { |
| 1084 | "command": { |
| 1085 | "listIndexes": "coll0", |
| 1086 | "cursor": { |
| 1087 | "batchSize": 2 |
| 1088 | } |
| 1089 | }, |
| 1090 | "commandName": "listIndexes", |
| 1091 | "databaseName": "database0Name" |
| 1092 | } |
| 1093 | }, |
| 1094 | { |
| 1095 | "commandSucceededEvent": { |
| 1096 | "commandName": "listIndexes" |
| 1097 | } |
| 1098 | }, |
| 1099 | { |
| 1100 | "commandStartedEvent": { |
| 1101 | "command": { |
| 1102 | "getMore": { |
| 1103 | "$$type": "long" |
| 1104 | }, |
| 1105 | "collection": "coll0" |
| 1106 | }, |
| 1107 | "commandName": "getMore" |
| 1108 | } |
| 1109 | }, |
| 1110 | { |
| 1111 | "commandSucceededEvent": { |
| 1112 | "reply": { |
| 1113 | "cursor": { |
| 1114 | "id": 0, |
| 1115 | "ns": { |
| 1116 | "$$type": "string" |
| 1117 | }, |
| 1118 | "nextBatch": { |
| 1119 | "$$type": "array" |
| 1120 | } |
| 1121 | } |
| 1122 | }, |
| 1123 | "commandName": "getMore" |
| 1124 | } |
| 1125 | } |
| 1126 | ] |
| 1127 | }, |
| 1128 | { |
| 1129 | "client": "client0", |
| 1130 | "eventType": "cmap", |
| 1131 | "events": [ |
| 1132 | { |
| 1133 | "connectionReadyEvent": {} |
| 1134 | }, |
| 1135 | { |
| 1136 | "connectionCheckedOutEvent": {} |
| 1137 | }, |
| 1138 | { |
| 1139 | "connectionCheckedInEvent": {} |
| 1140 | }, |
| 1141 | { |
| 1142 | "connectionCheckedOutEvent": {} |
| 1143 | }, |
| 1144 | { |
| 1145 | "connectionCheckedInEvent": {} |
| 1146 | }, |
| 1147 | { |
| 1148 | "connectionCheckedOutEvent": {} |
| 1149 | }, |
| 1150 | { |
| 1151 | "connectionCheckedInEvent": {} |
| 1152 | } |
| 1153 | ] |
| 1154 | } |
| 1155 | ] |
| 1156 | }, |
| 1157 | { |
| 1158 | "description": "change streams pin to a connection", |
| 1159 | "runOnRequirements": [ |
| 1160 | { |
| 1161 | "serverless": "forbid" |
| 1162 | } |
| 1163 | ], |
| 1164 | "operations": [ |
| 1165 | { |
| 1166 | "name": "createChangeStream", |
| 1167 | "object": "collection0", |
| 1168 | "arguments": { |
| 1169 | "pipeline": [] |
| 1170 | }, |
| 1171 | "saveResultAsEntity": "changeStream0" |
| 1172 | }, |
| 1173 | { |
| 1174 | "name": "assertNumberConnectionsCheckedOut", |
| 1175 | "object": "testRunner", |
| 1176 | "arguments": { |
| 1177 | "client": "client0", |
| 1178 | "connections": 1 |
| 1179 | } |
| 1180 | }, |
| 1181 | { |
| 1182 | "name": "close", |
| 1183 | "object": "changeStream0" |
| 1184 | }, |
| 1185 | { |
| 1186 | "name": "assertNumberConnectionsCheckedOut", |
| 1187 | "object": "testRunner", |
| 1188 | "arguments": { |
| 1189 | "client": "client0", |
| 1190 | "connections": 0 |
| 1191 | } |
| 1192 | } |
| 1193 | ], |
| 1194 | "expectEvents": [ |
| 1195 | { |
| 1196 | "client": "client0", |
| 1197 | "events": [ |
| 1198 | { |
| 1199 | "commandStartedEvent": { |
| 1200 | "commandName": "aggregate" |
| 1201 | } |
| 1202 | }, |
| 1203 | { |
| 1204 | "commandSucceededEvent": { |
| 1205 | "commandName": "aggregate" |
| 1206 | } |
| 1207 | }, |
| 1208 | { |
| 1209 | "commandStartedEvent": { |
| 1210 | "commandName": "killCursors" |
| 1211 | } |
| 1212 | }, |
| 1213 | { |
| 1214 | "commandSucceededEvent": { |
| 1215 | "commandName": "killCursors" |
| 1216 | } |
| 1217 | } |
| 1218 | ] |
| 1219 | }, |
| 1220 | { |
| 1221 | "client": "client0", |
| 1222 | "eventType": "cmap", |
| 1223 | "events": [ |
| 1224 | { |
| 1225 | "connectionReadyEvent": {} |
| 1226 | }, |
| 1227 | { |
| 1228 | "connectionCheckedOutEvent": {} |
| 1229 | }, |
| 1230 | { |
| 1231 | "connectionCheckedInEvent": {} |
| 1232 | } |
| 1233 | ] |
| 1234 | } |
| 1235 | ] |
| 1236 | } |
| 1237 | ] |
| 1238 | } |