...

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

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

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

View as plain text