...

Text file src/go.mongodb.org/mongo-driver/testdata/change-streams/change-streams-resume-allowlist.json

Documentation: go.mongodb.org/mongo-driver/testdata/change-streams

     1{
     2  "description": "change-streams-resume-allowlist",
     3  "schemaVersion": "1.7",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "3.6",
     7      "topologies": [
     8        "replicaset",
     9        "sharded-replicaset",
    10        "load-balanced"
    11      ],
    12      "serverless": "forbid"
    13    }
    14  ],
    15  "createEntities": [
    16    {
    17      "client": {
    18        "id": "client0",
    19        "observeEvents": [
    20          "commandStartedEvent"
    21        ],
    22        "ignoreCommandMonitoringEvents": [
    23          "killCursors"
    24        ],
    25        "useMultipleMongoses": false
    26      }
    27    },
    28    {
    29      "client": {
    30        "id": "globalClient",
    31        "useMultipleMongoses": false
    32      }
    33    },
    34    {
    35      "database": {
    36        "id": "database0",
    37        "client": "client0",
    38        "databaseName": "database0"
    39      }
    40    },
    41    {
    42      "collection": {
    43        "id": "collection0",
    44        "database": "database0",
    45        "collectionName": "collection0"
    46      }
    47    },
    48    {
    49      "database": {
    50        "id": "globalDatabase0",
    51        "client": "globalClient",
    52        "databaseName": "database0"
    53      }
    54    },
    55    {
    56      "collection": {
    57        "id": "globalCollection0",
    58        "database": "globalDatabase0",
    59        "collectionName": "collection0"
    60      }
    61    }
    62  ],
    63  "tests": [
    64    {
    65      "description": "change stream resumes after a network error",
    66      "runOnRequirements": [
    67        {
    68          "minServerVersion": "4.2"
    69        }
    70      ],
    71      "operations": [
    72        {
    73          "name": "failPoint",
    74          "object": "testRunner",
    75          "arguments": {
    76            "client": "globalClient",
    77            "failPoint": {
    78              "configureFailPoint": "failCommand",
    79              "mode": {
    80                "times": 1
    81              },
    82              "data": {
    83                "failCommands": [
    84                  "getMore"
    85                ],
    86                "closeConnection": true
    87              }
    88            }
    89          }
    90        },
    91        {
    92          "name": "createChangeStream",
    93          "object": "collection0",
    94          "arguments": {
    95            "pipeline": []
    96          },
    97          "saveResultAsEntity": "changeStream0"
    98        },
    99        {
   100          "name": "insertOne",
   101          "object": "globalCollection0",
   102          "arguments": {
   103            "document": {
   104              "x": 1
   105            }
   106          }
   107        },
   108        {
   109          "name": "iterateUntilDocumentOrError",
   110          "object": "changeStream0",
   111          "expectResult": {
   112            "_id": {
   113              "$$exists": true
   114            },
   115            "documentKey": {
   116              "$$exists": true
   117            },
   118            "operationType": "insert",
   119            "ns": {
   120              "db": "database0",
   121              "coll": "collection0"
   122            },
   123            "fullDocument": {
   124              "x": 1,
   125              "_id": {
   126                "$$exists": true
   127              }
   128            }
   129          }
   130        }
   131      ],
   132      "expectEvents": [
   133        {
   134          "client": "client0",
   135          "ignoreExtraEvents": true,
   136          "events": [
   137            {
   138              "commandStartedEvent": {
   139                "command": {
   140                  "aggregate": "collection0",
   141                  "cursor": {},
   142                  "pipeline": [
   143                    {
   144                      "$changeStream": {}
   145                    }
   146                  ]
   147                },
   148                "commandName": "aggregate",
   149                "databaseName": "database0"
   150              }
   151            },
   152            {
   153              "commandStartedEvent": {
   154                "command": {
   155                  "getMore": {
   156                    "$$exists": true
   157                  },
   158                  "collection": "collection0"
   159                },
   160                "commandName": "getMore",
   161                "databaseName": "database0"
   162              }
   163            },
   164            {
   165              "commandStartedEvent": {
   166                "command": {
   167                  "aggregate": "collection0",
   168                  "cursor": {},
   169                  "pipeline": [
   170                    {
   171                      "$changeStream": {
   172                        "resumeAfter": {
   173                          "$$unsetOrMatches": {
   174                            "$$exists": true
   175                          }
   176                        }
   177                      }
   178                    }
   179                  ]
   180                },
   181                "commandName": "aggregate",
   182                "databaseName": "database0"
   183              }
   184            }
   185          ]
   186        }
   187      ]
   188    },
   189    {
   190      "description": "change stream resumes after HostUnreachable",
   191      "runOnRequirements": [
   192        {
   193          "minServerVersion": "4.2",
   194          "maxServerVersion": "4.2.99"
   195        }
   196      ],
   197      "operations": [
   198        {
   199          "name": "failPoint",
   200          "object": "testRunner",
   201          "arguments": {
   202            "client": "globalClient",
   203            "failPoint": {
   204              "configureFailPoint": "failCommand",
   205              "mode": {
   206                "times": 1
   207              },
   208              "data": {
   209                "failCommands": [
   210                  "getMore"
   211                ],
   212                "errorCode": 6,
   213                "closeConnection": false
   214              }
   215            }
   216          }
   217        },
   218        {
   219          "name": "createChangeStream",
   220          "object": "collection0",
   221          "arguments": {
   222            "pipeline": []
   223          },
   224          "saveResultAsEntity": "changeStream0"
   225        },
   226        {
   227          "name": "insertOne",
   228          "object": "globalCollection0",
   229          "arguments": {
   230            "document": {
   231              "x": 1
   232            }
   233          }
   234        },
   235        {
   236          "name": "iterateUntilDocumentOrError",
   237          "object": "changeStream0",
   238          "expectResult": {
   239            "_id": {
   240              "$$exists": true
   241            },
   242            "documentKey": {
   243              "$$exists": true
   244            },
   245            "operationType": "insert",
   246            "ns": {
   247              "db": "database0",
   248              "coll": "collection0"
   249            },
   250            "fullDocument": {
   251              "x": 1,
   252              "_id": {
   253                "$$exists": true
   254              }
   255            }
   256          }
   257        }
   258      ],
   259      "expectEvents": [
   260        {
   261          "client": "client0",
   262          "ignoreExtraEvents": true,
   263          "events": [
   264            {
   265              "commandStartedEvent": {
   266                "command": {
   267                  "aggregate": "collection0",
   268                  "cursor": {},
   269                  "pipeline": [
   270                    {
   271                      "$changeStream": {}
   272                    }
   273                  ]
   274                },
   275                "commandName": "aggregate",
   276                "databaseName": "database0"
   277              }
   278            },
   279            {
   280              "commandStartedEvent": {
   281                "command": {
   282                  "getMore": {
   283                    "$$exists": true
   284                  },
   285                  "collection": "collection0"
   286                },
   287                "commandName": "getMore",
   288                "databaseName": "database0"
   289              }
   290            },
   291            {
   292              "commandStartedEvent": {
   293                "command": {
   294                  "aggregate": "collection0",
   295                  "cursor": {},
   296                  "pipeline": [
   297                    {
   298                      "$changeStream": {
   299                        "resumeAfter": {
   300                          "$$unsetOrMatches": {
   301                            "$$exists": true
   302                          }
   303                        }
   304                      }
   305                    }
   306                  ]
   307                },
   308                "commandName": "aggregate",
   309                "databaseName": "database0"
   310              }
   311            }
   312          ]
   313        }
   314      ]
   315    },
   316    {
   317      "description": "change stream resumes after HostNotFound",
   318      "runOnRequirements": [
   319        {
   320          "minServerVersion": "4.2",
   321          "maxServerVersion": "4.2.99"
   322        }
   323      ],
   324      "operations": [
   325        {
   326          "name": "failPoint",
   327          "object": "testRunner",
   328          "arguments": {
   329            "client": "globalClient",
   330            "failPoint": {
   331              "configureFailPoint": "failCommand",
   332              "mode": {
   333                "times": 1
   334              },
   335              "data": {
   336                "failCommands": [
   337                  "getMore"
   338                ],
   339                "errorCode": 7,
   340                "closeConnection": false
   341              }
   342            }
   343          }
   344        },
   345        {
   346          "name": "createChangeStream",
   347          "object": "collection0",
   348          "arguments": {
   349            "pipeline": []
   350          },
   351          "saveResultAsEntity": "changeStream0"
   352        },
   353        {
   354          "name": "insertOne",
   355          "object": "globalCollection0",
   356          "arguments": {
   357            "document": {
   358              "x": 1
   359            }
   360          }
   361        },
   362        {
   363          "name": "iterateUntilDocumentOrError",
   364          "object": "changeStream0",
   365          "expectResult": {
   366            "_id": {
   367              "$$exists": true
   368            },
   369            "documentKey": {
   370              "$$exists": true
   371            },
   372            "operationType": "insert",
   373            "ns": {
   374              "db": "database0",
   375              "coll": "collection0"
   376            },
   377            "fullDocument": {
   378              "x": 1,
   379              "_id": {
   380                "$$exists": true
   381              }
   382            }
   383          }
   384        }
   385      ],
   386      "expectEvents": [
   387        {
   388          "client": "client0",
   389          "ignoreExtraEvents": true,
   390          "events": [
   391            {
   392              "commandStartedEvent": {
   393                "command": {
   394                  "aggregate": "collection0",
   395                  "cursor": {},
   396                  "pipeline": [
   397                    {
   398                      "$changeStream": {}
   399                    }
   400                  ]
   401                },
   402                "commandName": "aggregate",
   403                "databaseName": "database0"
   404              }
   405            },
   406            {
   407              "commandStartedEvent": {
   408                "command": {
   409                  "getMore": {
   410                    "$$exists": true
   411                  },
   412                  "collection": "collection0"
   413                },
   414                "commandName": "getMore",
   415                "databaseName": "database0"
   416              }
   417            },
   418            {
   419              "commandStartedEvent": {
   420                "command": {
   421                  "aggregate": "collection0",
   422                  "cursor": {},
   423                  "pipeline": [
   424                    {
   425                      "$changeStream": {
   426                        "resumeAfter": {
   427                          "$$unsetOrMatches": {
   428                            "$$exists": true
   429                          }
   430                        }
   431                      }
   432                    }
   433                  ]
   434                },
   435                "commandName": "aggregate",
   436                "databaseName": "database0"
   437              }
   438            }
   439          ]
   440        }
   441      ]
   442    },
   443    {
   444      "description": "change stream resumes after NetworkTimeout",
   445      "runOnRequirements": [
   446        {
   447          "minServerVersion": "4.2",
   448          "maxServerVersion": "4.2.99"
   449        }
   450      ],
   451      "operations": [
   452        {
   453          "name": "failPoint",
   454          "object": "testRunner",
   455          "arguments": {
   456            "client": "globalClient",
   457            "failPoint": {
   458              "configureFailPoint": "failCommand",
   459              "mode": {
   460                "times": 1
   461              },
   462              "data": {
   463                "failCommands": [
   464                  "getMore"
   465                ],
   466                "errorCode": 89,
   467                "closeConnection": false
   468              }
   469            }
   470          }
   471        },
   472        {
   473          "name": "createChangeStream",
   474          "object": "collection0",
   475          "arguments": {
   476            "pipeline": []
   477          },
   478          "saveResultAsEntity": "changeStream0"
   479        },
   480        {
   481          "name": "insertOne",
   482          "object": "globalCollection0",
   483          "arguments": {
   484            "document": {
   485              "x": 1
   486            }
   487          }
   488        },
   489        {
   490          "name": "iterateUntilDocumentOrError",
   491          "object": "changeStream0",
   492          "expectResult": {
   493            "_id": {
   494              "$$exists": true
   495            },
   496            "documentKey": {
   497              "$$exists": true
   498            },
   499            "operationType": "insert",
   500            "ns": {
   501              "db": "database0",
   502              "coll": "collection0"
   503            },
   504            "fullDocument": {
   505              "x": 1,
   506              "_id": {
   507                "$$exists": true
   508              }
   509            }
   510          }
   511        }
   512      ],
   513      "expectEvents": [
   514        {
   515          "client": "client0",
   516          "ignoreExtraEvents": true,
   517          "events": [
   518            {
   519              "commandStartedEvent": {
   520                "command": {
   521                  "aggregate": "collection0",
   522                  "cursor": {},
   523                  "pipeline": [
   524                    {
   525                      "$changeStream": {}
   526                    }
   527                  ]
   528                },
   529                "commandName": "aggregate",
   530                "databaseName": "database0"
   531              }
   532            },
   533            {
   534              "commandStartedEvent": {
   535                "command": {
   536                  "getMore": {
   537                    "$$exists": true
   538                  },
   539                  "collection": "collection0"
   540                },
   541                "commandName": "getMore",
   542                "databaseName": "database0"
   543              }
   544            },
   545            {
   546              "commandStartedEvent": {
   547                "command": {
   548                  "aggregate": "collection0",
   549                  "cursor": {},
   550                  "pipeline": [
   551                    {
   552                      "$changeStream": {
   553                        "resumeAfter": {
   554                          "$$unsetOrMatches": {
   555                            "$$exists": true
   556                          }
   557                        }
   558                      }
   559                    }
   560                  ]
   561                },
   562                "commandName": "aggregate",
   563                "databaseName": "database0"
   564              }
   565            }
   566          ]
   567        }
   568      ]
   569    },
   570    {
   571      "description": "change stream resumes after ShutdownInProgress",
   572      "runOnRequirements": [
   573        {
   574          "minServerVersion": "4.2",
   575          "maxServerVersion": "4.2.99"
   576        }
   577      ],
   578      "operations": [
   579        {
   580          "name": "failPoint",
   581          "object": "testRunner",
   582          "arguments": {
   583            "client": "globalClient",
   584            "failPoint": {
   585              "configureFailPoint": "failCommand",
   586              "mode": {
   587                "times": 1
   588              },
   589              "data": {
   590                "failCommands": [
   591                  "getMore"
   592                ],
   593                "errorCode": 91,
   594                "closeConnection": false
   595              }
   596            }
   597          }
   598        },
   599        {
   600          "name": "createChangeStream",
   601          "object": "collection0",
   602          "arguments": {
   603            "pipeline": []
   604          },
   605          "saveResultAsEntity": "changeStream0"
   606        },
   607        {
   608          "name": "insertOne",
   609          "object": "globalCollection0",
   610          "arguments": {
   611            "document": {
   612              "x": 1
   613            }
   614          }
   615        },
   616        {
   617          "name": "iterateUntilDocumentOrError",
   618          "object": "changeStream0",
   619          "expectResult": {
   620            "_id": {
   621              "$$exists": true
   622            },
   623            "documentKey": {
   624              "$$exists": true
   625            },
   626            "operationType": "insert",
   627            "ns": {
   628              "db": "database0",
   629              "coll": "collection0"
   630            },
   631            "fullDocument": {
   632              "x": 1,
   633              "_id": {
   634                "$$exists": true
   635              }
   636            }
   637          }
   638        }
   639      ],
   640      "expectEvents": [
   641        {
   642          "client": "client0",
   643          "ignoreExtraEvents": true,
   644          "events": [
   645            {
   646              "commandStartedEvent": {
   647                "command": {
   648                  "aggregate": "collection0",
   649                  "cursor": {},
   650                  "pipeline": [
   651                    {
   652                      "$changeStream": {}
   653                    }
   654                  ]
   655                },
   656                "commandName": "aggregate",
   657                "databaseName": "database0"
   658              }
   659            },
   660            {
   661              "commandStartedEvent": {
   662                "command": {
   663                  "getMore": {
   664                    "$$exists": true
   665                  },
   666                  "collection": "collection0"
   667                },
   668                "commandName": "getMore",
   669                "databaseName": "database0"
   670              }
   671            },
   672            {
   673              "commandStartedEvent": {
   674                "command": {
   675                  "aggregate": "collection0",
   676                  "cursor": {},
   677                  "pipeline": [
   678                    {
   679                      "$changeStream": {
   680                        "resumeAfter": {
   681                          "$$unsetOrMatches": {
   682                            "$$exists": true
   683                          }
   684                        }
   685                      }
   686                    }
   687                  ]
   688                },
   689                "commandName": "aggregate",
   690                "databaseName": "database0"
   691              }
   692            }
   693          ]
   694        }
   695      ]
   696    },
   697    {
   698      "description": "change stream resumes after PrimarySteppedDown",
   699      "runOnRequirements": [
   700        {
   701          "minServerVersion": "4.2",
   702          "maxServerVersion": "4.2.99"
   703        }
   704      ],
   705      "operations": [
   706        {
   707          "name": "failPoint",
   708          "object": "testRunner",
   709          "arguments": {
   710            "client": "globalClient",
   711            "failPoint": {
   712              "configureFailPoint": "failCommand",
   713              "mode": {
   714                "times": 1
   715              },
   716              "data": {
   717                "failCommands": [
   718                  "getMore"
   719                ],
   720                "errorCode": 189,
   721                "closeConnection": false
   722              }
   723            }
   724          }
   725        },
   726        {
   727          "name": "createChangeStream",
   728          "object": "collection0",
   729          "arguments": {
   730            "pipeline": []
   731          },
   732          "saveResultAsEntity": "changeStream0"
   733        },
   734        {
   735          "name": "insertOne",
   736          "object": "globalCollection0",
   737          "arguments": {
   738            "document": {
   739              "x": 1
   740            }
   741          }
   742        },
   743        {
   744          "name": "iterateUntilDocumentOrError",
   745          "object": "changeStream0",
   746          "expectResult": {
   747            "_id": {
   748              "$$exists": true
   749            },
   750            "documentKey": {
   751              "$$exists": true
   752            },
   753            "operationType": "insert",
   754            "ns": {
   755              "db": "database0",
   756              "coll": "collection0"
   757            },
   758            "fullDocument": {
   759              "x": 1,
   760              "_id": {
   761                "$$exists": true
   762              }
   763            }
   764          }
   765        }
   766      ],
   767      "expectEvents": [
   768        {
   769          "client": "client0",
   770          "ignoreExtraEvents": true,
   771          "events": [
   772            {
   773              "commandStartedEvent": {
   774                "command": {
   775                  "aggregate": "collection0",
   776                  "cursor": {},
   777                  "pipeline": [
   778                    {
   779                      "$changeStream": {}
   780                    }
   781                  ]
   782                },
   783                "commandName": "aggregate",
   784                "databaseName": "database0"
   785              }
   786            },
   787            {
   788              "commandStartedEvent": {
   789                "command": {
   790                  "getMore": {
   791                    "$$exists": true
   792                  },
   793                  "collection": "collection0"
   794                },
   795                "commandName": "getMore",
   796                "databaseName": "database0"
   797              }
   798            },
   799            {
   800              "commandStartedEvent": {
   801                "command": {
   802                  "aggregate": "collection0",
   803                  "cursor": {},
   804                  "pipeline": [
   805                    {
   806                      "$changeStream": {
   807                        "resumeAfter": {
   808                          "$$unsetOrMatches": {
   809                            "$$exists": true
   810                          }
   811                        }
   812                      }
   813                    }
   814                  ]
   815                },
   816                "commandName": "aggregate",
   817                "databaseName": "database0"
   818              }
   819            }
   820          ]
   821        }
   822      ]
   823    },
   824    {
   825      "description": "change stream resumes after ExceededTimeLimit",
   826      "runOnRequirements": [
   827        {
   828          "minServerVersion": "4.2",
   829          "maxServerVersion": "4.2.99"
   830        }
   831      ],
   832      "operations": [
   833        {
   834          "name": "failPoint",
   835          "object": "testRunner",
   836          "arguments": {
   837            "client": "globalClient",
   838            "failPoint": {
   839              "configureFailPoint": "failCommand",
   840              "mode": {
   841                "times": 1
   842              },
   843              "data": {
   844                "failCommands": [
   845                  "getMore"
   846                ],
   847                "errorCode": 262,
   848                "closeConnection": false
   849              }
   850            }
   851          }
   852        },
   853        {
   854          "name": "createChangeStream",
   855          "object": "collection0",
   856          "arguments": {
   857            "pipeline": []
   858          },
   859          "saveResultAsEntity": "changeStream0"
   860        },
   861        {
   862          "name": "insertOne",
   863          "object": "globalCollection0",
   864          "arguments": {
   865            "document": {
   866              "x": 1
   867            }
   868          }
   869        },
   870        {
   871          "name": "iterateUntilDocumentOrError",
   872          "object": "changeStream0",
   873          "expectResult": {
   874            "_id": {
   875              "$$exists": true
   876            },
   877            "documentKey": {
   878              "$$exists": true
   879            },
   880            "operationType": "insert",
   881            "ns": {
   882              "db": "database0",
   883              "coll": "collection0"
   884            },
   885            "fullDocument": {
   886              "x": 1,
   887              "_id": {
   888                "$$exists": true
   889              }
   890            }
   891          }
   892        }
   893      ],
   894      "expectEvents": [
   895        {
   896          "client": "client0",
   897          "ignoreExtraEvents": true,
   898          "events": [
   899            {
   900              "commandStartedEvent": {
   901                "command": {
   902                  "aggregate": "collection0",
   903                  "cursor": {},
   904                  "pipeline": [
   905                    {
   906                      "$changeStream": {}
   907                    }
   908                  ]
   909                },
   910                "commandName": "aggregate",
   911                "databaseName": "database0"
   912              }
   913            },
   914            {
   915              "commandStartedEvent": {
   916                "command": {
   917                  "getMore": {
   918                    "$$exists": true
   919                  },
   920                  "collection": "collection0"
   921                },
   922                "commandName": "getMore",
   923                "databaseName": "database0"
   924              }
   925            },
   926            {
   927              "commandStartedEvent": {
   928                "command": {
   929                  "aggregate": "collection0",
   930                  "cursor": {},
   931                  "pipeline": [
   932                    {
   933                      "$changeStream": {
   934                        "resumeAfter": {
   935                          "$$unsetOrMatches": {
   936                            "$$exists": true
   937                          }
   938                        }
   939                      }
   940                    }
   941                  ]
   942                },
   943                "commandName": "aggregate",
   944                "databaseName": "database0"
   945              }
   946            }
   947          ]
   948        }
   949      ]
   950    },
   951    {
   952      "description": "change stream resumes after SocketException",
   953      "runOnRequirements": [
   954        {
   955          "minServerVersion": "4.2",
   956          "maxServerVersion": "4.2.99"
   957        }
   958      ],
   959      "operations": [
   960        {
   961          "name": "failPoint",
   962          "object": "testRunner",
   963          "arguments": {
   964            "client": "globalClient",
   965            "failPoint": {
   966              "configureFailPoint": "failCommand",
   967              "mode": {
   968                "times": 1
   969              },
   970              "data": {
   971                "failCommands": [
   972                  "getMore"
   973                ],
   974                "errorCode": 9001,
   975                "closeConnection": false
   976              }
   977            }
   978          }
   979        },
   980        {
   981          "name": "createChangeStream",
   982          "object": "collection0",
   983          "arguments": {
   984            "pipeline": []
   985          },
   986          "saveResultAsEntity": "changeStream0"
   987        },
   988        {
   989          "name": "insertOne",
   990          "object": "globalCollection0",
   991          "arguments": {
   992            "document": {
   993              "x": 1
   994            }
   995          }
   996        },
   997        {
   998          "name": "iterateUntilDocumentOrError",
   999          "object": "changeStream0",
  1000          "expectResult": {
  1001            "_id": {
  1002              "$$exists": true
  1003            },
  1004            "documentKey": {
  1005              "$$exists": true
  1006            },
  1007            "operationType": "insert",
  1008            "ns": {
  1009              "db": "database0",
  1010              "coll": "collection0"
  1011            },
  1012            "fullDocument": {
  1013              "x": 1,
  1014              "_id": {
  1015                "$$exists": true
  1016              }
  1017            }
  1018          }
  1019        }
  1020      ],
  1021      "expectEvents": [
  1022        {
  1023          "client": "client0",
  1024          "ignoreExtraEvents": true,
  1025          "events": [
  1026            {
  1027              "commandStartedEvent": {
  1028                "command": {
  1029                  "aggregate": "collection0",
  1030                  "cursor": {},
  1031                  "pipeline": [
  1032                    {
  1033                      "$changeStream": {}
  1034                    }
  1035                  ]
  1036                },
  1037                "commandName": "aggregate",
  1038                "databaseName": "database0"
  1039              }
  1040            },
  1041            {
  1042              "commandStartedEvent": {
  1043                "command": {
  1044                  "getMore": {
  1045                    "$$exists": true
  1046                  },
  1047                  "collection": "collection0"
  1048                },
  1049                "commandName": "getMore",
  1050                "databaseName": "database0"
  1051              }
  1052            },
  1053            {
  1054              "commandStartedEvent": {
  1055                "command": {
  1056                  "aggregate": "collection0",
  1057                  "cursor": {},
  1058                  "pipeline": [
  1059                    {
  1060                      "$changeStream": {
  1061                        "resumeAfter": {
  1062                          "$$unsetOrMatches": {
  1063                            "$$exists": true
  1064                          }
  1065                        }
  1066                      }
  1067                    }
  1068                  ]
  1069                },
  1070                "commandName": "aggregate",
  1071                "databaseName": "database0"
  1072              }
  1073            }
  1074          ]
  1075        }
  1076      ]
  1077    },
  1078    {
  1079      "description": "change stream resumes after NotWritablePrimary",
  1080      "runOnRequirements": [
  1081        {
  1082          "minServerVersion": "4.2",
  1083          "maxServerVersion": "4.2.99"
  1084        }
  1085      ],
  1086      "operations": [
  1087        {
  1088          "name": "failPoint",
  1089          "object": "testRunner",
  1090          "arguments": {
  1091            "client": "globalClient",
  1092            "failPoint": {
  1093              "configureFailPoint": "failCommand",
  1094              "mode": {
  1095                "times": 1
  1096              },
  1097              "data": {
  1098                "failCommands": [
  1099                  "getMore"
  1100                ],
  1101                "errorCode": 10107,
  1102                "closeConnection": false
  1103              }
  1104            }
  1105          }
  1106        },
  1107        {
  1108          "name": "createChangeStream",
  1109          "object": "collection0",
  1110          "arguments": {
  1111            "pipeline": []
  1112          },
  1113          "saveResultAsEntity": "changeStream0"
  1114        },
  1115        {
  1116          "name": "insertOne",
  1117          "object": "globalCollection0",
  1118          "arguments": {
  1119            "document": {
  1120              "x": 1
  1121            }
  1122          }
  1123        },
  1124        {
  1125          "name": "iterateUntilDocumentOrError",
  1126          "object": "changeStream0",
  1127          "expectResult": {
  1128            "_id": {
  1129              "$$exists": true
  1130            },
  1131            "documentKey": {
  1132              "$$exists": true
  1133            },
  1134            "operationType": "insert",
  1135            "ns": {
  1136              "db": "database0",
  1137              "coll": "collection0"
  1138            },
  1139            "fullDocument": {
  1140              "x": 1,
  1141              "_id": {
  1142                "$$exists": true
  1143              }
  1144            }
  1145          }
  1146        }
  1147      ],
  1148      "expectEvents": [
  1149        {
  1150          "client": "client0",
  1151          "ignoreExtraEvents": true,
  1152          "events": [
  1153            {
  1154              "commandStartedEvent": {
  1155                "command": {
  1156                  "aggregate": "collection0",
  1157                  "cursor": {},
  1158                  "pipeline": [
  1159                    {
  1160                      "$changeStream": {}
  1161                    }
  1162                  ]
  1163                },
  1164                "commandName": "aggregate",
  1165                "databaseName": "database0"
  1166              }
  1167            },
  1168            {
  1169              "commandStartedEvent": {
  1170                "command": {
  1171                  "getMore": {
  1172                    "$$exists": true
  1173                  },
  1174                  "collection": "collection0"
  1175                },
  1176                "commandName": "getMore",
  1177                "databaseName": "database0"
  1178              }
  1179            },
  1180            {
  1181              "commandStartedEvent": {
  1182                "command": {
  1183                  "aggregate": "collection0",
  1184                  "cursor": {},
  1185                  "pipeline": [
  1186                    {
  1187                      "$changeStream": {
  1188                        "resumeAfter": {
  1189                          "$$unsetOrMatches": {
  1190                            "$$exists": true
  1191                          }
  1192                        }
  1193                      }
  1194                    }
  1195                  ]
  1196                },
  1197                "commandName": "aggregate",
  1198                "databaseName": "database0"
  1199              }
  1200            }
  1201          ]
  1202        }
  1203      ]
  1204    },
  1205    {
  1206      "description": "change stream resumes after InterruptedAtShutdown",
  1207      "runOnRequirements": [
  1208        {
  1209          "minServerVersion": "4.2",
  1210          "maxServerVersion": "4.2.99"
  1211        }
  1212      ],
  1213      "operations": [
  1214        {
  1215          "name": "failPoint",
  1216          "object": "testRunner",
  1217          "arguments": {
  1218            "client": "globalClient",
  1219            "failPoint": {
  1220              "configureFailPoint": "failCommand",
  1221              "mode": {
  1222                "times": 1
  1223              },
  1224              "data": {
  1225                "failCommands": [
  1226                  "getMore"
  1227                ],
  1228                "errorCode": 11600,
  1229                "closeConnection": false
  1230              }
  1231            }
  1232          }
  1233        },
  1234        {
  1235          "name": "createChangeStream",
  1236          "object": "collection0",
  1237          "arguments": {
  1238            "pipeline": []
  1239          },
  1240          "saveResultAsEntity": "changeStream0"
  1241        },
  1242        {
  1243          "name": "insertOne",
  1244          "object": "globalCollection0",
  1245          "arguments": {
  1246            "document": {
  1247              "x": 1
  1248            }
  1249          }
  1250        },
  1251        {
  1252          "name": "iterateUntilDocumentOrError",
  1253          "object": "changeStream0",
  1254          "expectResult": {
  1255            "_id": {
  1256              "$$exists": true
  1257            },
  1258            "documentKey": {
  1259              "$$exists": true
  1260            },
  1261            "operationType": "insert",
  1262            "ns": {
  1263              "db": "database0",
  1264              "coll": "collection0"
  1265            },
  1266            "fullDocument": {
  1267              "x": 1,
  1268              "_id": {
  1269                "$$exists": true
  1270              }
  1271            }
  1272          }
  1273        }
  1274      ],
  1275      "expectEvents": [
  1276        {
  1277          "client": "client0",
  1278          "ignoreExtraEvents": true,
  1279          "events": [
  1280            {
  1281              "commandStartedEvent": {
  1282                "command": {
  1283                  "aggregate": "collection0",
  1284                  "cursor": {},
  1285                  "pipeline": [
  1286                    {
  1287                      "$changeStream": {}
  1288                    }
  1289                  ]
  1290                },
  1291                "commandName": "aggregate",
  1292                "databaseName": "database0"
  1293              }
  1294            },
  1295            {
  1296              "commandStartedEvent": {
  1297                "command": {
  1298                  "getMore": {
  1299                    "$$exists": true
  1300                  },
  1301                  "collection": "collection0"
  1302                },
  1303                "commandName": "getMore",
  1304                "databaseName": "database0"
  1305              }
  1306            },
  1307            {
  1308              "commandStartedEvent": {
  1309                "command": {
  1310                  "aggregate": "collection0",
  1311                  "cursor": {},
  1312                  "pipeline": [
  1313                    {
  1314                      "$changeStream": {
  1315                        "resumeAfter": {
  1316                          "$$unsetOrMatches": {
  1317                            "$$exists": true
  1318                          }
  1319                        }
  1320                      }
  1321                    }
  1322                  ]
  1323                },
  1324                "commandName": "aggregate",
  1325                "databaseName": "database0"
  1326              }
  1327            }
  1328          ]
  1329        }
  1330      ]
  1331    },
  1332    {
  1333      "description": "change stream resumes after InterruptedDueToReplStateChange",
  1334      "runOnRequirements": [
  1335        {
  1336          "minServerVersion": "4.2",
  1337          "maxServerVersion": "4.2.99"
  1338        }
  1339      ],
  1340      "operations": [
  1341        {
  1342          "name": "failPoint",
  1343          "object": "testRunner",
  1344          "arguments": {
  1345            "client": "globalClient",
  1346            "failPoint": {
  1347              "configureFailPoint": "failCommand",
  1348              "mode": {
  1349                "times": 1
  1350              },
  1351              "data": {
  1352                "failCommands": [
  1353                  "getMore"
  1354                ],
  1355                "errorCode": 11602,
  1356                "closeConnection": false
  1357              }
  1358            }
  1359          }
  1360        },
  1361        {
  1362          "name": "createChangeStream",
  1363          "object": "collection0",
  1364          "arguments": {
  1365            "pipeline": []
  1366          },
  1367          "saveResultAsEntity": "changeStream0"
  1368        },
  1369        {
  1370          "name": "insertOne",
  1371          "object": "globalCollection0",
  1372          "arguments": {
  1373            "document": {
  1374              "x": 1
  1375            }
  1376          }
  1377        },
  1378        {
  1379          "name": "iterateUntilDocumentOrError",
  1380          "object": "changeStream0",
  1381          "expectResult": {
  1382            "_id": {
  1383              "$$exists": true
  1384            },
  1385            "documentKey": {
  1386              "$$exists": true
  1387            },
  1388            "operationType": "insert",
  1389            "ns": {
  1390              "db": "database0",
  1391              "coll": "collection0"
  1392            },
  1393            "fullDocument": {
  1394              "x": 1,
  1395              "_id": {
  1396                "$$exists": true
  1397              }
  1398            }
  1399          }
  1400        }
  1401      ],
  1402      "expectEvents": [
  1403        {
  1404          "client": "client0",
  1405          "ignoreExtraEvents": true,
  1406          "events": [
  1407            {
  1408              "commandStartedEvent": {
  1409                "command": {
  1410                  "aggregate": "collection0",
  1411                  "cursor": {},
  1412                  "pipeline": [
  1413                    {
  1414                      "$changeStream": {}
  1415                    }
  1416                  ]
  1417                },
  1418                "commandName": "aggregate",
  1419                "databaseName": "database0"
  1420              }
  1421            },
  1422            {
  1423              "commandStartedEvent": {
  1424                "command": {
  1425                  "getMore": {
  1426                    "$$exists": true
  1427                  },
  1428                  "collection": "collection0"
  1429                },
  1430                "commandName": "getMore",
  1431                "databaseName": "database0"
  1432              }
  1433            },
  1434            {
  1435              "commandStartedEvent": {
  1436                "command": {
  1437                  "aggregate": "collection0",
  1438                  "cursor": {},
  1439                  "pipeline": [
  1440                    {
  1441                      "$changeStream": {
  1442                        "resumeAfter": {
  1443                          "$$unsetOrMatches": {
  1444                            "$$exists": true
  1445                          }
  1446                        }
  1447                      }
  1448                    }
  1449                  ]
  1450                },
  1451                "commandName": "aggregate",
  1452                "databaseName": "database0"
  1453              }
  1454            }
  1455          ]
  1456        }
  1457      ]
  1458    },
  1459    {
  1460      "description": "change stream resumes after NotPrimaryNoSecondaryOk",
  1461      "runOnRequirements": [
  1462        {
  1463          "minServerVersion": "4.2",
  1464          "maxServerVersion": "4.2.99"
  1465        }
  1466      ],
  1467      "operations": [
  1468        {
  1469          "name": "failPoint",
  1470          "object": "testRunner",
  1471          "arguments": {
  1472            "client": "globalClient",
  1473            "failPoint": {
  1474              "configureFailPoint": "failCommand",
  1475              "mode": {
  1476                "times": 1
  1477              },
  1478              "data": {
  1479                "failCommands": [
  1480                  "getMore"
  1481                ],
  1482                "errorCode": 13435,
  1483                "closeConnection": false
  1484              }
  1485            }
  1486          }
  1487        },
  1488        {
  1489          "name": "createChangeStream",
  1490          "object": "collection0",
  1491          "arguments": {
  1492            "pipeline": []
  1493          },
  1494          "saveResultAsEntity": "changeStream0"
  1495        },
  1496        {
  1497          "name": "insertOne",
  1498          "object": "globalCollection0",
  1499          "arguments": {
  1500            "document": {
  1501              "x": 1
  1502            }
  1503          }
  1504        },
  1505        {
  1506          "name": "iterateUntilDocumentOrError",
  1507          "object": "changeStream0",
  1508          "expectResult": {
  1509            "_id": {
  1510              "$$exists": true
  1511            },
  1512            "documentKey": {
  1513              "$$exists": true
  1514            },
  1515            "operationType": "insert",
  1516            "ns": {
  1517              "db": "database0",
  1518              "coll": "collection0"
  1519            },
  1520            "fullDocument": {
  1521              "x": 1,
  1522              "_id": {
  1523                "$$exists": true
  1524              }
  1525            }
  1526          }
  1527        }
  1528      ],
  1529      "expectEvents": [
  1530        {
  1531          "client": "client0",
  1532          "ignoreExtraEvents": true,
  1533          "events": [
  1534            {
  1535              "commandStartedEvent": {
  1536                "command": {
  1537                  "aggregate": "collection0",
  1538                  "cursor": {},
  1539                  "pipeline": [
  1540                    {
  1541                      "$changeStream": {}
  1542                    }
  1543                  ]
  1544                },
  1545                "commandName": "aggregate",
  1546                "databaseName": "database0"
  1547              }
  1548            },
  1549            {
  1550              "commandStartedEvent": {
  1551                "command": {
  1552                  "getMore": {
  1553                    "$$exists": true
  1554                  },
  1555                  "collection": "collection0"
  1556                },
  1557                "commandName": "getMore",
  1558                "databaseName": "database0"
  1559              }
  1560            },
  1561            {
  1562              "commandStartedEvent": {
  1563                "command": {
  1564                  "aggregate": "collection0",
  1565                  "cursor": {},
  1566                  "pipeline": [
  1567                    {
  1568                      "$changeStream": {
  1569                        "resumeAfter": {
  1570                          "$$unsetOrMatches": {
  1571                            "$$exists": true
  1572                          }
  1573                        }
  1574                      }
  1575                    }
  1576                  ]
  1577                },
  1578                "commandName": "aggregate",
  1579                "databaseName": "database0"
  1580              }
  1581            }
  1582          ]
  1583        }
  1584      ]
  1585    },
  1586    {
  1587      "description": "change stream resumes after NotPrimaryOrSecondary",
  1588      "runOnRequirements": [
  1589        {
  1590          "minServerVersion": "4.2",
  1591          "maxServerVersion": "4.2.99"
  1592        }
  1593      ],
  1594      "operations": [
  1595        {
  1596          "name": "failPoint",
  1597          "object": "testRunner",
  1598          "arguments": {
  1599            "client": "globalClient",
  1600            "failPoint": {
  1601              "configureFailPoint": "failCommand",
  1602              "mode": {
  1603                "times": 1
  1604              },
  1605              "data": {
  1606                "failCommands": [
  1607                  "getMore"
  1608                ],
  1609                "errorCode": 13436,
  1610                "closeConnection": false
  1611              }
  1612            }
  1613          }
  1614        },
  1615        {
  1616          "name": "createChangeStream",
  1617          "object": "collection0",
  1618          "arguments": {
  1619            "pipeline": []
  1620          },
  1621          "saveResultAsEntity": "changeStream0"
  1622        },
  1623        {
  1624          "name": "insertOne",
  1625          "object": "globalCollection0",
  1626          "arguments": {
  1627            "document": {
  1628              "x": 1
  1629            }
  1630          }
  1631        },
  1632        {
  1633          "name": "iterateUntilDocumentOrError",
  1634          "object": "changeStream0",
  1635          "expectResult": {
  1636            "_id": {
  1637              "$$exists": true
  1638            },
  1639            "documentKey": {
  1640              "$$exists": true
  1641            },
  1642            "operationType": "insert",
  1643            "ns": {
  1644              "db": "database0",
  1645              "coll": "collection0"
  1646            },
  1647            "fullDocument": {
  1648              "x": 1,
  1649              "_id": {
  1650                "$$exists": true
  1651              }
  1652            }
  1653          }
  1654        }
  1655      ],
  1656      "expectEvents": [
  1657        {
  1658          "client": "client0",
  1659          "ignoreExtraEvents": true,
  1660          "events": [
  1661            {
  1662              "commandStartedEvent": {
  1663                "command": {
  1664                  "aggregate": "collection0",
  1665                  "cursor": {},
  1666                  "pipeline": [
  1667                    {
  1668                      "$changeStream": {}
  1669                    }
  1670                  ]
  1671                },
  1672                "commandName": "aggregate",
  1673                "databaseName": "database0"
  1674              }
  1675            },
  1676            {
  1677              "commandStartedEvent": {
  1678                "command": {
  1679                  "getMore": {
  1680                    "$$exists": true
  1681                  },
  1682                  "collection": "collection0"
  1683                },
  1684                "commandName": "getMore",
  1685                "databaseName": "database0"
  1686              }
  1687            },
  1688            {
  1689              "commandStartedEvent": {
  1690                "command": {
  1691                  "aggregate": "collection0",
  1692                  "cursor": {},
  1693                  "pipeline": [
  1694                    {
  1695                      "$changeStream": {
  1696                        "resumeAfter": {
  1697                          "$$unsetOrMatches": {
  1698                            "$$exists": true
  1699                          }
  1700                        }
  1701                      }
  1702                    }
  1703                  ]
  1704                },
  1705                "commandName": "aggregate",
  1706                "databaseName": "database0"
  1707              }
  1708            }
  1709          ]
  1710        }
  1711      ]
  1712    },
  1713    {
  1714      "description": "change stream resumes after StaleShardVersion",
  1715      "runOnRequirements": [
  1716        {
  1717          "minServerVersion": "4.2",
  1718          "maxServerVersion": "4.2.99"
  1719        }
  1720      ],
  1721      "operations": [
  1722        {
  1723          "name": "failPoint",
  1724          "object": "testRunner",
  1725          "arguments": {
  1726            "client": "globalClient",
  1727            "failPoint": {
  1728              "configureFailPoint": "failCommand",
  1729              "mode": {
  1730                "times": 1
  1731              },
  1732              "data": {
  1733                "failCommands": [
  1734                  "getMore"
  1735                ],
  1736                "errorCode": 63,
  1737                "closeConnection": false
  1738              }
  1739            }
  1740          }
  1741        },
  1742        {
  1743          "name": "createChangeStream",
  1744          "object": "collection0",
  1745          "arguments": {
  1746            "pipeline": []
  1747          },
  1748          "saveResultAsEntity": "changeStream0"
  1749        },
  1750        {
  1751          "name": "insertOne",
  1752          "object": "globalCollection0",
  1753          "arguments": {
  1754            "document": {
  1755              "x": 1
  1756            }
  1757          }
  1758        },
  1759        {
  1760          "name": "iterateUntilDocumentOrError",
  1761          "object": "changeStream0",
  1762          "expectResult": {
  1763            "_id": {
  1764              "$$exists": true
  1765            },
  1766            "documentKey": {
  1767              "$$exists": true
  1768            },
  1769            "operationType": "insert",
  1770            "ns": {
  1771              "db": "database0",
  1772              "coll": "collection0"
  1773            },
  1774            "fullDocument": {
  1775              "x": 1,
  1776              "_id": {
  1777                "$$exists": true
  1778              }
  1779            }
  1780          }
  1781        }
  1782      ],
  1783      "expectEvents": [
  1784        {
  1785          "client": "client0",
  1786          "ignoreExtraEvents": true,
  1787          "events": [
  1788            {
  1789              "commandStartedEvent": {
  1790                "command": {
  1791                  "aggregate": "collection0",
  1792                  "cursor": {},
  1793                  "pipeline": [
  1794                    {
  1795                      "$changeStream": {}
  1796                    }
  1797                  ]
  1798                },
  1799                "commandName": "aggregate",
  1800                "databaseName": "database0"
  1801              }
  1802            },
  1803            {
  1804              "commandStartedEvent": {
  1805                "command": {
  1806                  "getMore": {
  1807                    "$$exists": true
  1808                  },
  1809                  "collection": "collection0"
  1810                },
  1811                "commandName": "getMore",
  1812                "databaseName": "database0"
  1813              }
  1814            },
  1815            {
  1816              "commandStartedEvent": {
  1817                "command": {
  1818                  "aggregate": "collection0",
  1819                  "cursor": {},
  1820                  "pipeline": [
  1821                    {
  1822                      "$changeStream": {
  1823                        "resumeAfter": {
  1824                          "$$unsetOrMatches": {
  1825                            "$$exists": true
  1826                          }
  1827                        }
  1828                      }
  1829                    }
  1830                  ]
  1831                },
  1832                "commandName": "aggregate",
  1833                "databaseName": "database0"
  1834              }
  1835            }
  1836          ]
  1837        }
  1838      ]
  1839    },
  1840    {
  1841      "description": "change stream resumes after StaleEpoch",
  1842      "runOnRequirements": [
  1843        {
  1844          "minServerVersion": "4.2",
  1845          "maxServerVersion": "4.2.99"
  1846        }
  1847      ],
  1848      "operations": [
  1849        {
  1850          "name": "failPoint",
  1851          "object": "testRunner",
  1852          "arguments": {
  1853            "client": "globalClient",
  1854            "failPoint": {
  1855              "configureFailPoint": "failCommand",
  1856              "mode": {
  1857                "times": 1
  1858              },
  1859              "data": {
  1860                "failCommands": [
  1861                  "getMore"
  1862                ],
  1863                "errorCode": 150,
  1864                "closeConnection": false
  1865              }
  1866            }
  1867          }
  1868        },
  1869        {
  1870          "name": "createChangeStream",
  1871          "object": "collection0",
  1872          "arguments": {
  1873            "pipeline": []
  1874          },
  1875          "saveResultAsEntity": "changeStream0"
  1876        },
  1877        {
  1878          "name": "insertOne",
  1879          "object": "globalCollection0",
  1880          "arguments": {
  1881            "document": {
  1882              "x": 1
  1883            }
  1884          }
  1885        },
  1886        {
  1887          "name": "iterateUntilDocumentOrError",
  1888          "object": "changeStream0",
  1889          "expectResult": {
  1890            "_id": {
  1891              "$$exists": true
  1892            },
  1893            "documentKey": {
  1894              "$$exists": true
  1895            },
  1896            "operationType": "insert",
  1897            "ns": {
  1898              "db": "database0",
  1899              "coll": "collection0"
  1900            },
  1901            "fullDocument": {
  1902              "x": 1,
  1903              "_id": {
  1904                "$$exists": true
  1905              }
  1906            }
  1907          }
  1908        }
  1909      ],
  1910      "expectEvents": [
  1911        {
  1912          "client": "client0",
  1913          "ignoreExtraEvents": true,
  1914          "events": [
  1915            {
  1916              "commandStartedEvent": {
  1917                "command": {
  1918                  "aggregate": "collection0",
  1919                  "cursor": {},
  1920                  "pipeline": [
  1921                    {
  1922                      "$changeStream": {}
  1923                    }
  1924                  ]
  1925                },
  1926                "commandName": "aggregate",
  1927                "databaseName": "database0"
  1928              }
  1929            },
  1930            {
  1931              "commandStartedEvent": {
  1932                "command": {
  1933                  "getMore": {
  1934                    "$$exists": true
  1935                  },
  1936                  "collection": "collection0"
  1937                },
  1938                "commandName": "getMore",
  1939                "databaseName": "database0"
  1940              }
  1941            },
  1942            {
  1943              "commandStartedEvent": {
  1944                "command": {
  1945                  "aggregate": "collection0",
  1946                  "cursor": {},
  1947                  "pipeline": [
  1948                    {
  1949                      "$changeStream": {
  1950                        "resumeAfter": {
  1951                          "$$unsetOrMatches": {
  1952                            "$$exists": true
  1953                          }
  1954                        }
  1955                      }
  1956                    }
  1957                  ]
  1958                },
  1959                "commandName": "aggregate",
  1960                "databaseName": "database0"
  1961              }
  1962            }
  1963          ]
  1964        }
  1965      ]
  1966    },
  1967    {
  1968      "description": "change stream resumes after RetryChangeStream",
  1969      "runOnRequirements": [
  1970        {
  1971          "minServerVersion": "4.2",
  1972          "maxServerVersion": "4.2.99"
  1973        }
  1974      ],
  1975      "operations": [
  1976        {
  1977          "name": "failPoint",
  1978          "object": "testRunner",
  1979          "arguments": {
  1980            "client": "globalClient",
  1981            "failPoint": {
  1982              "configureFailPoint": "failCommand",
  1983              "mode": {
  1984                "times": 1
  1985              },
  1986              "data": {
  1987                "failCommands": [
  1988                  "getMore"
  1989                ],
  1990                "errorCode": 234,
  1991                "closeConnection": false
  1992              }
  1993            }
  1994          }
  1995        },
  1996        {
  1997          "name": "createChangeStream",
  1998          "object": "collection0",
  1999          "arguments": {
  2000            "pipeline": []
  2001          },
  2002          "saveResultAsEntity": "changeStream0"
  2003        },
  2004        {
  2005          "name": "insertOne",
  2006          "object": "globalCollection0",
  2007          "arguments": {
  2008            "document": {
  2009              "x": 1
  2010            }
  2011          }
  2012        },
  2013        {
  2014          "name": "iterateUntilDocumentOrError",
  2015          "object": "changeStream0",
  2016          "expectResult": {
  2017            "_id": {
  2018              "$$exists": true
  2019            },
  2020            "documentKey": {
  2021              "$$exists": true
  2022            },
  2023            "operationType": "insert",
  2024            "ns": {
  2025              "db": "database0",
  2026              "coll": "collection0"
  2027            },
  2028            "fullDocument": {
  2029              "x": 1,
  2030              "_id": {
  2031                "$$exists": true
  2032              }
  2033            }
  2034          }
  2035        }
  2036      ],
  2037      "expectEvents": [
  2038        {
  2039          "client": "client0",
  2040          "ignoreExtraEvents": true,
  2041          "events": [
  2042            {
  2043              "commandStartedEvent": {
  2044                "command": {
  2045                  "aggregate": "collection0",
  2046                  "cursor": {},
  2047                  "pipeline": [
  2048                    {
  2049                      "$changeStream": {}
  2050                    }
  2051                  ]
  2052                },
  2053                "commandName": "aggregate",
  2054                "databaseName": "database0"
  2055              }
  2056            },
  2057            {
  2058              "commandStartedEvent": {
  2059                "command": {
  2060                  "getMore": {
  2061                    "$$exists": true
  2062                  },
  2063                  "collection": "collection0"
  2064                },
  2065                "commandName": "getMore",
  2066                "databaseName": "database0"
  2067              }
  2068            },
  2069            {
  2070              "commandStartedEvent": {
  2071                "command": {
  2072                  "aggregate": "collection0",
  2073                  "cursor": {},
  2074                  "pipeline": [
  2075                    {
  2076                      "$changeStream": {
  2077                        "resumeAfter": {
  2078                          "$$unsetOrMatches": {
  2079                            "$$exists": true
  2080                          }
  2081                        }
  2082                      }
  2083                    }
  2084                  ]
  2085                },
  2086                "commandName": "aggregate",
  2087                "databaseName": "database0"
  2088              }
  2089            }
  2090          ]
  2091        }
  2092      ]
  2093    },
  2094    {
  2095      "description": "change stream resumes after FailedToSatisfyReadPreference",
  2096      "runOnRequirements": [
  2097        {
  2098          "minServerVersion": "4.2",
  2099          "maxServerVersion": "4.2.99"
  2100        }
  2101      ],
  2102      "operations": [
  2103        {
  2104          "name": "failPoint",
  2105          "object": "testRunner",
  2106          "arguments": {
  2107            "client": "globalClient",
  2108            "failPoint": {
  2109              "configureFailPoint": "failCommand",
  2110              "mode": {
  2111                "times": 1
  2112              },
  2113              "data": {
  2114                "failCommands": [
  2115                  "getMore"
  2116                ],
  2117                "errorCode": 133,
  2118                "closeConnection": false
  2119              }
  2120            }
  2121          }
  2122        },
  2123        {
  2124          "name": "createChangeStream",
  2125          "object": "collection0",
  2126          "arguments": {
  2127            "pipeline": []
  2128          },
  2129          "saveResultAsEntity": "changeStream0"
  2130        },
  2131        {
  2132          "name": "insertOne",
  2133          "object": "globalCollection0",
  2134          "arguments": {
  2135            "document": {
  2136              "x": 1
  2137            }
  2138          }
  2139        },
  2140        {
  2141          "name": "iterateUntilDocumentOrError",
  2142          "object": "changeStream0",
  2143          "expectResult": {
  2144            "_id": {
  2145              "$$exists": true
  2146            },
  2147            "documentKey": {
  2148              "$$exists": true
  2149            },
  2150            "operationType": "insert",
  2151            "ns": {
  2152              "db": "database0",
  2153              "coll": "collection0"
  2154            },
  2155            "fullDocument": {
  2156              "x": 1,
  2157              "_id": {
  2158                "$$exists": true
  2159              }
  2160            }
  2161          }
  2162        }
  2163      ],
  2164      "expectEvents": [
  2165        {
  2166          "client": "client0",
  2167          "ignoreExtraEvents": true,
  2168          "events": [
  2169            {
  2170              "commandStartedEvent": {
  2171                "command": {
  2172                  "aggregate": "collection0",
  2173                  "cursor": {},
  2174                  "pipeline": [
  2175                    {
  2176                      "$changeStream": {}
  2177                    }
  2178                  ]
  2179                },
  2180                "commandName": "aggregate",
  2181                "databaseName": "database0"
  2182              }
  2183            },
  2184            {
  2185              "commandStartedEvent": {
  2186                "command": {
  2187                  "getMore": {
  2188                    "$$exists": true
  2189                  },
  2190                  "collection": "collection0"
  2191                },
  2192                "commandName": "getMore",
  2193                "databaseName": "database0"
  2194              }
  2195            },
  2196            {
  2197              "commandStartedEvent": {
  2198                "command": {
  2199                  "aggregate": "collection0",
  2200                  "cursor": {},
  2201                  "pipeline": [
  2202                    {
  2203                      "$changeStream": {
  2204                        "resumeAfter": {
  2205                          "$$unsetOrMatches": {
  2206                            "$$exists": true
  2207                          }
  2208                        }
  2209                      }
  2210                    }
  2211                  ]
  2212                },
  2213                "commandName": "aggregate",
  2214                "databaseName": "database0"
  2215              }
  2216            }
  2217          ]
  2218        }
  2219      ]
  2220    },
  2221    {
  2222      "description": "change stream resumes after CursorNotFound",
  2223      "runOnRequirements": [
  2224        {
  2225          "minServerVersion": "4.2"
  2226        }
  2227      ],
  2228      "operations": [
  2229        {
  2230          "name": "failPoint",
  2231          "object": "testRunner",
  2232          "arguments": {
  2233            "client": "globalClient",
  2234            "failPoint": {
  2235              "configureFailPoint": "failCommand",
  2236              "mode": {
  2237                "times": 1
  2238              },
  2239              "data": {
  2240                "failCommands": [
  2241                  "getMore"
  2242                ],
  2243                "errorCode": 43,
  2244                "closeConnection": false
  2245              }
  2246            }
  2247          }
  2248        },
  2249        {
  2250          "name": "createChangeStream",
  2251          "object": "collection0",
  2252          "arguments": {
  2253            "pipeline": []
  2254          },
  2255          "saveResultAsEntity": "changeStream0"
  2256        },
  2257        {
  2258          "name": "insertOne",
  2259          "object": "globalCollection0",
  2260          "arguments": {
  2261            "document": {
  2262              "x": 1
  2263            }
  2264          }
  2265        },
  2266        {
  2267          "name": "iterateUntilDocumentOrError",
  2268          "object": "changeStream0",
  2269          "expectResult": {
  2270            "_id": {
  2271              "$$exists": true
  2272            },
  2273            "documentKey": {
  2274              "$$exists": true
  2275            },
  2276            "operationType": "insert",
  2277            "ns": {
  2278              "db": "database0",
  2279              "coll": "collection0"
  2280            },
  2281            "fullDocument": {
  2282              "x": 1,
  2283              "_id": {
  2284                "$$exists": true
  2285              }
  2286            }
  2287          }
  2288        }
  2289      ],
  2290      "expectEvents": [
  2291        {
  2292          "client": "client0",
  2293          "ignoreExtraEvents": true,
  2294          "events": [
  2295            {
  2296              "commandStartedEvent": {
  2297                "command": {
  2298                  "aggregate": "collection0",
  2299                  "cursor": {},
  2300                  "pipeline": [
  2301                    {
  2302                      "$changeStream": {}
  2303                    }
  2304                  ]
  2305                },
  2306                "commandName": "aggregate",
  2307                "databaseName": "database0"
  2308              }
  2309            },
  2310            {
  2311              "commandStartedEvent": {
  2312                "command": {
  2313                  "getMore": {
  2314                    "$$exists": true
  2315                  },
  2316                  "collection": "collection0"
  2317                },
  2318                "commandName": "getMore",
  2319                "databaseName": "database0"
  2320              }
  2321            },
  2322            {
  2323              "commandStartedEvent": {
  2324                "command": {
  2325                  "aggregate": "collection0",
  2326                  "cursor": {},
  2327                  "pipeline": [
  2328                    {
  2329                      "$changeStream": {
  2330                        "resumeAfter": {
  2331                          "$$unsetOrMatches": {
  2332                            "$$exists": true
  2333                          }
  2334                        }
  2335                      }
  2336                    }
  2337                  ]
  2338                },
  2339                "commandName": "aggregate",
  2340                "databaseName": "database0"
  2341              }
  2342            }
  2343          ]
  2344        }
  2345      ]
  2346    }
  2347  ]
  2348}

View as plain text