...

Text file src/go.mongodb.org/mongo-driver/testdata/client-side-operations-timeout/retryability-legacy-timeouts.yml

Documentation: go.mongodb.org/mongo-driver/testdata/client-side-operations-timeout

     1# Tests in this file are generated from retryability-legacy-timeouts.yml.template.
     2
     3description: "legacy timeouts behave correctly for retryable operations"
     4
     5schemaVersion: "1.9"
     6
     7runOnRequirements:
     8  - minServerVersion: "4.4"
     9    topologies: ["replicaset", "sharded-replicaset"]
    10
    11createEntities:
    12  - client:
    13      id: &failPointClient failPointClient
    14      useMultipleMongoses: false
    15  - client:
    16      id: &client client
    17      uriOptions:
    18        socketTimeoutMS: 100
    19      useMultipleMongoses: false
    20      observeEvents:
    21        - commandStartedEvent
    22      ignoreCommandMonitoringEvents:
    23        - killCursors
    24  - database:
    25      id: &database database
    26      client: *client
    27      databaseName: &databaseName test
    28  - collection:
    29      id: &collection collection
    30      database: *database
    31      collectionName: &collectionName coll
    32
    33initialData:
    34  - collectionName: *collectionName
    35    databaseName: *databaseName
    36    documents: []
    37
    38tests:
    39  # For each retryable operation, run two tests:
    40  #
    41  # 1. Socket timeouts are retried once - Each test constructs a client entity with socketTimeoutMS=50, configures a
    42  # fail point to block the operation once for 110ms, and expects the operation to succeed.
    43  #
    44  # 2. Operations fail after two consecutive socket timeouts - Same as (1) but the fail point is configured to block
    45  # the operation twice and the test expects the operation to fail.
    46
    47  - description: "operation succeeds after one socket timeout - insertOne on collection"
    48    operations:
    49      - name: failPoint
    50        object: testRunner
    51        arguments:
    52          client: *failPointClient
    53          failPoint:
    54            configureFailPoint: failCommand
    55            mode: { times: 1 }
    56            data:
    57              failCommands: ["insert"]
    58              blockConnection: true
    59              blockTimeMS: 110
    60      - name: insertOne
    61        object: *collection
    62        arguments:
    63          document: { x: 1 }
    64          
    65    expectEvents:
    66      - client: *client
    67        events:
    68          - commandStartedEvent:
    69              commandName: insert
    70              databaseName: *databaseName
    71              command:
    72                insert: *collectionName
    73          - commandStartedEvent:
    74              commandName: insert
    75              databaseName: *databaseName
    76              command:
    77                insert: *collectionName
    78  - description: "operation fails after two consecutive socket timeouts - insertOne on collection"
    79    operations:
    80      - name: failPoint
    81        object: testRunner
    82        arguments:
    83          client: *failPointClient
    84          failPoint:
    85            configureFailPoint: failCommand
    86            mode: { times: 2 }
    87            data:
    88              failCommands: ["insert"]
    89              blockConnection: true
    90              blockTimeMS: 110
    91      - name: insertOne
    92        object: *collection
    93        arguments:
    94          document: { x: 1 }
    95          
    96        expectError:
    97            # Network errors are considered client errors by the unified test format spec.
    98            isClientError: true
    99    expectEvents:
   100      - client: *client
   101        events:
   102          - commandStartedEvent:
   103              commandName: insert
   104              databaseName: *databaseName
   105              command:
   106                insert: *collectionName
   107          - commandStartedEvent:
   108              commandName: insert
   109              databaseName: *databaseName
   110              command:
   111                insert: *collectionName
   112  - description: "operation succeeds after one socket timeout - insertMany on collection"
   113    operations:
   114      - name: failPoint
   115        object: testRunner
   116        arguments:
   117          client: *failPointClient
   118          failPoint:
   119            configureFailPoint: failCommand
   120            mode: { times: 1 }
   121            data:
   122              failCommands: ["insert"]
   123              blockConnection: true
   124              blockTimeMS: 110
   125      - name: insertMany
   126        object: *collection
   127        arguments:
   128          documents:
   129            - { x: 1 }
   130          
   131    expectEvents:
   132      - client: *client
   133        events:
   134          - commandStartedEvent:
   135              commandName: insert
   136              databaseName: *databaseName
   137              command:
   138                insert: *collectionName
   139          - commandStartedEvent:
   140              commandName: insert
   141              databaseName: *databaseName
   142              command:
   143                insert: *collectionName
   144  - description: "operation fails after two consecutive socket timeouts - insertMany on collection"
   145    operations:
   146      - name: failPoint
   147        object: testRunner
   148        arguments:
   149          client: *failPointClient
   150          failPoint:
   151            configureFailPoint: failCommand
   152            mode: { times: 2 }
   153            data:
   154              failCommands: ["insert"]
   155              blockConnection: true
   156              blockTimeMS: 110
   157      - name: insertMany
   158        object: *collection
   159        arguments:
   160          documents:
   161            - { x: 1 }
   162          
   163        expectError:
   164            # Network errors are considered client errors by the unified test format spec.
   165            isClientError: true
   166    expectEvents:
   167      - client: *client
   168        events:
   169          - commandStartedEvent:
   170              commandName: insert
   171              databaseName: *databaseName
   172              command:
   173                insert: *collectionName
   174          - commandStartedEvent:
   175              commandName: insert
   176              databaseName: *databaseName
   177              command:
   178                insert: *collectionName
   179  - description: "operation succeeds after one socket timeout - deleteOne on collection"
   180    operations:
   181      - name: failPoint
   182        object: testRunner
   183        arguments:
   184          client: *failPointClient
   185          failPoint:
   186            configureFailPoint: failCommand
   187            mode: { times: 1 }
   188            data:
   189              failCommands: ["delete"]
   190              blockConnection: true
   191              blockTimeMS: 110
   192      - name: deleteOne
   193        object: *collection
   194        arguments:
   195          filter: {}
   196          
   197    expectEvents:
   198      - client: *client
   199        events:
   200          - commandStartedEvent:
   201              commandName: delete
   202              databaseName: *databaseName
   203              command:
   204                delete: *collectionName
   205          - commandStartedEvent:
   206              commandName: delete
   207              databaseName: *databaseName
   208              command:
   209                delete: *collectionName
   210  - description: "operation fails after two consecutive socket timeouts - deleteOne on collection"
   211    operations:
   212      - name: failPoint
   213        object: testRunner
   214        arguments:
   215          client: *failPointClient
   216          failPoint:
   217            configureFailPoint: failCommand
   218            mode: { times: 2 }
   219            data:
   220              failCommands: ["delete"]
   221              blockConnection: true
   222              blockTimeMS: 110
   223      - name: deleteOne
   224        object: *collection
   225        arguments:
   226          filter: {}
   227          
   228        expectError:
   229            # Network errors are considered client errors by the unified test format spec.
   230            isClientError: true
   231    expectEvents:
   232      - client: *client
   233        events:
   234          - commandStartedEvent:
   235              commandName: delete
   236              databaseName: *databaseName
   237              command:
   238                delete: *collectionName
   239          - commandStartedEvent:
   240              commandName: delete
   241              databaseName: *databaseName
   242              command:
   243                delete: *collectionName
   244  - description: "operation succeeds after one socket timeout - replaceOne on collection"
   245    operations:
   246      - name: failPoint
   247        object: testRunner
   248        arguments:
   249          client: *failPointClient
   250          failPoint:
   251            configureFailPoint: failCommand
   252            mode: { times: 1 }
   253            data:
   254              failCommands: ["update"]
   255              blockConnection: true
   256              blockTimeMS: 110
   257      - name: replaceOne
   258        object: *collection
   259        arguments:
   260          filter: {}
   261          replacement: { x: 1 }
   262          
   263    expectEvents:
   264      - client: *client
   265        events:
   266          - commandStartedEvent:
   267              commandName: update
   268              databaseName: *databaseName
   269              command:
   270                update: *collectionName
   271          - commandStartedEvent:
   272              commandName: update
   273              databaseName: *databaseName
   274              command:
   275                update: *collectionName
   276  - description: "operation fails after two consecutive socket timeouts - replaceOne on collection"
   277    operations:
   278      - name: failPoint
   279        object: testRunner
   280        arguments:
   281          client: *failPointClient
   282          failPoint:
   283            configureFailPoint: failCommand
   284            mode: { times: 2 }
   285            data:
   286              failCommands: ["update"]
   287              blockConnection: true
   288              blockTimeMS: 110
   289      - name: replaceOne
   290        object: *collection
   291        arguments:
   292          filter: {}
   293          replacement: { x: 1 }
   294          
   295        expectError:
   296            # Network errors are considered client errors by the unified test format spec.
   297            isClientError: true
   298    expectEvents:
   299      - client: *client
   300        events:
   301          - commandStartedEvent:
   302              commandName: update
   303              databaseName: *databaseName
   304              command:
   305                update: *collectionName
   306          - commandStartedEvent:
   307              commandName: update
   308              databaseName: *databaseName
   309              command:
   310                update: *collectionName
   311  - description: "operation succeeds after one socket timeout - updateOne on collection"
   312    operations:
   313      - name: failPoint
   314        object: testRunner
   315        arguments:
   316          client: *failPointClient
   317          failPoint:
   318            configureFailPoint: failCommand
   319            mode: { times: 1 }
   320            data:
   321              failCommands: ["update"]
   322              blockConnection: true
   323              blockTimeMS: 110
   324      - name: updateOne
   325        object: *collection
   326        arguments:
   327          filter: {}
   328          update: { $set: { x: 1 } }
   329          
   330    expectEvents:
   331      - client: *client
   332        events:
   333          - commandStartedEvent:
   334              commandName: update
   335              databaseName: *databaseName
   336              command:
   337                update: *collectionName
   338          - commandStartedEvent:
   339              commandName: update
   340              databaseName: *databaseName
   341              command:
   342                update: *collectionName
   343  - description: "operation fails after two consecutive socket timeouts - updateOne on collection"
   344    operations:
   345      - name: failPoint
   346        object: testRunner
   347        arguments:
   348          client: *failPointClient
   349          failPoint:
   350            configureFailPoint: failCommand
   351            mode: { times: 2 }
   352            data:
   353              failCommands: ["update"]
   354              blockConnection: true
   355              blockTimeMS: 110
   356      - name: updateOne
   357        object: *collection
   358        arguments:
   359          filter: {}
   360          update: { $set: { x: 1 } }
   361          
   362        expectError:
   363            # Network errors are considered client errors by the unified test format spec.
   364            isClientError: true
   365    expectEvents:
   366      - client: *client
   367        events:
   368          - commandStartedEvent:
   369              commandName: update
   370              databaseName: *databaseName
   371              command:
   372                update: *collectionName
   373          - commandStartedEvent:
   374              commandName: update
   375              databaseName: *databaseName
   376              command:
   377                update: *collectionName
   378  - description: "operation succeeds after one socket timeout - findOneAndDelete on collection"
   379    operations:
   380      - name: failPoint
   381        object: testRunner
   382        arguments:
   383          client: *failPointClient
   384          failPoint:
   385            configureFailPoint: failCommand
   386            mode: { times: 1 }
   387            data:
   388              failCommands: ["findAndModify"]
   389              blockConnection: true
   390              blockTimeMS: 110
   391      - name: findOneAndDelete
   392        object: *collection
   393        arguments:
   394          filter: {}
   395          
   396    expectEvents:
   397      - client: *client
   398        events:
   399          - commandStartedEvent:
   400              commandName: findAndModify
   401              databaseName: *databaseName
   402              command:
   403                findAndModify: *collectionName
   404          - commandStartedEvent:
   405              commandName: findAndModify
   406              databaseName: *databaseName
   407              command:
   408                findAndModify: *collectionName
   409  - description: "operation fails after two consecutive socket timeouts - findOneAndDelete on collection"
   410    operations:
   411      - name: failPoint
   412        object: testRunner
   413        arguments:
   414          client: *failPointClient
   415          failPoint:
   416            configureFailPoint: failCommand
   417            mode: { times: 2 }
   418            data:
   419              failCommands: ["findAndModify"]
   420              blockConnection: true
   421              blockTimeMS: 110
   422      - name: findOneAndDelete
   423        object: *collection
   424        arguments:
   425          filter: {}
   426          
   427        expectError:
   428            # Network errors are considered client errors by the unified test format spec.
   429            isClientError: true
   430    expectEvents:
   431      - client: *client
   432        events:
   433          - commandStartedEvent:
   434              commandName: findAndModify
   435              databaseName: *databaseName
   436              command:
   437                findAndModify: *collectionName
   438          - commandStartedEvent:
   439              commandName: findAndModify
   440              databaseName: *databaseName
   441              command:
   442                findAndModify: *collectionName
   443  - description: "operation succeeds after one socket timeout - findOneAndReplace on collection"
   444    operations:
   445      - name: failPoint
   446        object: testRunner
   447        arguments:
   448          client: *failPointClient
   449          failPoint:
   450            configureFailPoint: failCommand
   451            mode: { times: 1 }
   452            data:
   453              failCommands: ["findAndModify"]
   454              blockConnection: true
   455              blockTimeMS: 110
   456      - name: findOneAndReplace
   457        object: *collection
   458        arguments:
   459          filter: {}
   460          replacement: { x: 1 }
   461          
   462    expectEvents:
   463      - client: *client
   464        events:
   465          - commandStartedEvent:
   466              commandName: findAndModify
   467              databaseName: *databaseName
   468              command:
   469                findAndModify: *collectionName
   470          - commandStartedEvent:
   471              commandName: findAndModify
   472              databaseName: *databaseName
   473              command:
   474                findAndModify: *collectionName
   475  - description: "operation fails after two consecutive socket timeouts - findOneAndReplace on collection"
   476    operations:
   477      - name: failPoint
   478        object: testRunner
   479        arguments:
   480          client: *failPointClient
   481          failPoint:
   482            configureFailPoint: failCommand
   483            mode: { times: 2 }
   484            data:
   485              failCommands: ["findAndModify"]
   486              blockConnection: true
   487              blockTimeMS: 110
   488      - name: findOneAndReplace
   489        object: *collection
   490        arguments:
   491          filter: {}
   492          replacement: { x: 1 }
   493          
   494        expectError:
   495            # Network errors are considered client errors by the unified test format spec.
   496            isClientError: true
   497    expectEvents:
   498      - client: *client
   499        events:
   500          - commandStartedEvent:
   501              commandName: findAndModify
   502              databaseName: *databaseName
   503              command:
   504                findAndModify: *collectionName
   505          - commandStartedEvent:
   506              commandName: findAndModify
   507              databaseName: *databaseName
   508              command:
   509                findAndModify: *collectionName
   510  - description: "operation succeeds after one socket timeout - findOneAndUpdate on collection"
   511    operations:
   512      - name: failPoint
   513        object: testRunner
   514        arguments:
   515          client: *failPointClient
   516          failPoint:
   517            configureFailPoint: failCommand
   518            mode: { times: 1 }
   519            data:
   520              failCommands: ["findAndModify"]
   521              blockConnection: true
   522              blockTimeMS: 110
   523      - name: findOneAndUpdate
   524        object: *collection
   525        arguments:
   526          filter: {}
   527          update: { $set: { x: 1 } }
   528          
   529    expectEvents:
   530      - client: *client
   531        events:
   532          - commandStartedEvent:
   533              commandName: findAndModify
   534              databaseName: *databaseName
   535              command:
   536                findAndModify: *collectionName
   537          - commandStartedEvent:
   538              commandName: findAndModify
   539              databaseName: *databaseName
   540              command:
   541                findAndModify: *collectionName
   542  - description: "operation fails after two consecutive socket timeouts - findOneAndUpdate on collection"
   543    operations:
   544      - name: failPoint
   545        object: testRunner
   546        arguments:
   547          client: *failPointClient
   548          failPoint:
   549            configureFailPoint: failCommand
   550            mode: { times: 2 }
   551            data:
   552              failCommands: ["findAndModify"]
   553              blockConnection: true
   554              blockTimeMS: 110
   555      - name: findOneAndUpdate
   556        object: *collection
   557        arguments:
   558          filter: {}
   559          update: { $set: { x: 1 } }
   560          
   561        expectError:
   562            # Network errors are considered client errors by the unified test format spec.
   563            isClientError: true
   564    expectEvents:
   565      - client: *client
   566        events:
   567          - commandStartedEvent:
   568              commandName: findAndModify
   569              databaseName: *databaseName
   570              command:
   571                findAndModify: *collectionName
   572          - commandStartedEvent:
   573              commandName: findAndModify
   574              databaseName: *databaseName
   575              command:
   576                findAndModify: *collectionName
   577  - description: "operation succeeds after one socket timeout - bulkWrite on collection"
   578    operations:
   579      - name: failPoint
   580        object: testRunner
   581        arguments:
   582          client: *failPointClient
   583          failPoint:
   584            configureFailPoint: failCommand
   585            mode: { times: 1 }
   586            data:
   587              failCommands: ["insert"]
   588              blockConnection: true
   589              blockTimeMS: 110
   590      - name: bulkWrite
   591        object: *collection
   592        arguments:
   593          requests:
   594            - insertOne:
   595                document: { _id: 1 }
   596          
   597    expectEvents:
   598      - client: *client
   599        events:
   600          - commandStartedEvent:
   601              commandName: insert
   602              databaseName: *databaseName
   603              command:
   604                insert: *collectionName
   605          - commandStartedEvent:
   606              commandName: insert
   607              databaseName: *databaseName
   608              command:
   609                insert: *collectionName
   610  - description: "operation fails after two consecutive socket timeouts - bulkWrite on collection"
   611    operations:
   612      - name: failPoint
   613        object: testRunner
   614        arguments:
   615          client: *failPointClient
   616          failPoint:
   617            configureFailPoint: failCommand
   618            mode: { times: 2 }
   619            data:
   620              failCommands: ["insert"]
   621              blockConnection: true
   622              blockTimeMS: 110
   623      - name: bulkWrite
   624        object: *collection
   625        arguments:
   626          requests:
   627            - insertOne:
   628                document: { _id: 1 }
   629          
   630        expectError:
   631            # Network errors are considered client errors by the unified test format spec.
   632            isClientError: true
   633    expectEvents:
   634      - client: *client
   635        events:
   636          - commandStartedEvent:
   637              commandName: insert
   638              databaseName: *databaseName
   639              command:
   640                insert: *collectionName
   641          - commandStartedEvent:
   642              commandName: insert
   643              databaseName: *databaseName
   644              command:
   645                insert: *collectionName
   646  - description: "operation succeeds after one socket timeout - listDatabases on client"
   647    operations:
   648      - name: failPoint
   649        object: testRunner
   650        arguments:
   651          client: *failPointClient
   652          failPoint:
   653            configureFailPoint: failCommand
   654            mode: { times: 1 }
   655            data:
   656              failCommands: ["listDatabases"]
   657              blockConnection: true
   658              blockTimeMS: 110
   659      - name: listDatabases
   660        object: *client
   661        arguments:
   662          filter: {}
   663          
   664    expectEvents:
   665      - client: *client
   666        events:
   667          - commandStartedEvent:
   668              commandName: listDatabases
   669              databaseName: admin
   670              command:
   671                listDatabases: 1
   672          - commandStartedEvent:
   673              commandName: listDatabases
   674              databaseName: admin
   675              command:
   676                listDatabases: 1
   677  - description: "operation fails after two consecutive socket timeouts - listDatabases on client"
   678    operations:
   679      - name: failPoint
   680        object: testRunner
   681        arguments:
   682          client: *failPointClient
   683          failPoint:
   684            configureFailPoint: failCommand
   685            mode: { times: 2 }
   686            data:
   687              failCommands: ["listDatabases"]
   688              blockConnection: true
   689              blockTimeMS: 110
   690      - name: listDatabases
   691        object: *client
   692        arguments:
   693          filter: {}
   694          
   695        expectError:
   696            # Network errors are considered client errors by the unified test format spec.
   697            isClientError: true
   698    expectEvents:
   699      - client: *client
   700        events:
   701          - commandStartedEvent:
   702              commandName: listDatabases
   703              databaseName: admin
   704              command:
   705                listDatabases: 1
   706          - commandStartedEvent:
   707              commandName: listDatabases
   708              databaseName: admin
   709              command:
   710                listDatabases: 1
   711  - description: "operation succeeds after one socket timeout - listDatabaseNames on client"
   712    operations:
   713      - name: failPoint
   714        object: testRunner
   715        arguments:
   716          client: *failPointClient
   717          failPoint:
   718            configureFailPoint: failCommand
   719            mode: { times: 1 }
   720            data:
   721              failCommands: ["listDatabases"]
   722              blockConnection: true
   723              blockTimeMS: 110
   724      - name: listDatabaseNames
   725        object: *client
   726        
   727    expectEvents:
   728      - client: *client
   729        events:
   730          - commandStartedEvent:
   731              commandName: listDatabases
   732              databaseName: admin
   733              command:
   734                listDatabases: 1
   735          - commandStartedEvent:
   736              commandName: listDatabases
   737              databaseName: admin
   738              command:
   739                listDatabases: 1
   740  - description: "operation fails after two consecutive socket timeouts - listDatabaseNames on client"
   741    operations:
   742      - name: failPoint
   743        object: testRunner
   744        arguments:
   745          client: *failPointClient
   746          failPoint:
   747            configureFailPoint: failCommand
   748            mode: { times: 2 }
   749            data:
   750              failCommands: ["listDatabases"]
   751              blockConnection: true
   752              blockTimeMS: 110
   753      - name: listDatabaseNames
   754        object: *client
   755        
   756        expectError:
   757            # Network errors are considered client errors by the unified test format spec.
   758            isClientError: true
   759    expectEvents:
   760      - client: *client
   761        events:
   762          - commandStartedEvent:
   763              commandName: listDatabases
   764              databaseName: admin
   765              command:
   766                listDatabases: 1
   767          - commandStartedEvent:
   768              commandName: listDatabases
   769              databaseName: admin
   770              command:
   771                listDatabases: 1
   772  - description: "operation succeeds after one socket timeout - createChangeStream on client"
   773    operations:
   774      - name: failPoint
   775        object: testRunner
   776        arguments:
   777          client: *failPointClient
   778          failPoint:
   779            configureFailPoint: failCommand
   780            mode: { times: 1 }
   781            data:
   782              failCommands: ["aggregate"]
   783              blockConnection: true
   784              blockTimeMS: 110
   785      - name: createChangeStream
   786        object: *client
   787        arguments:
   788          pipeline: []
   789          
   790    expectEvents:
   791      - client: *client
   792        events:
   793          - commandStartedEvent:
   794              commandName: aggregate
   795              databaseName: admin
   796              command:
   797                aggregate: 1
   798          - commandStartedEvent:
   799              commandName: aggregate
   800              databaseName: admin
   801              command:
   802                aggregate: 1
   803  - description: "operation fails after two consecutive socket timeouts - createChangeStream on client"
   804    operations:
   805      - name: failPoint
   806        object: testRunner
   807        arguments:
   808          client: *failPointClient
   809          failPoint:
   810            configureFailPoint: failCommand
   811            mode: { times: 2 }
   812            data:
   813              failCommands: ["aggregate"]
   814              blockConnection: true
   815              blockTimeMS: 110
   816      - name: createChangeStream
   817        object: *client
   818        arguments:
   819          pipeline: []
   820          
   821        expectError:
   822            # Network errors are considered client errors by the unified test format spec.
   823            isClientError: true
   824    expectEvents:
   825      - client: *client
   826        events:
   827          - commandStartedEvent:
   828              commandName: aggregate
   829              databaseName: admin
   830              command:
   831                aggregate: 1
   832          - commandStartedEvent:
   833              commandName: aggregate
   834              databaseName: admin
   835              command:
   836                aggregate: 1
   837  - description: "operation succeeds after one socket timeout - aggregate on database"
   838    operations:
   839      - name: failPoint
   840        object: testRunner
   841        arguments:
   842          client: *failPointClient
   843          failPoint:
   844            configureFailPoint: failCommand
   845            mode: { times: 1 }
   846            data:
   847              failCommands: ["aggregate"]
   848              blockConnection: true
   849              blockTimeMS: 110
   850      - name: aggregate
   851        object: *database
   852        arguments:
   853          pipeline: [ { $listLocalSessions: {} }, { $limit: 1 } ]
   854          
   855    expectEvents:
   856      - client: *client
   857        events:
   858          - commandStartedEvent:
   859              commandName: aggregate
   860              databaseName: *databaseName
   861              command:
   862                aggregate: 1
   863          - commandStartedEvent:
   864              commandName: aggregate
   865              databaseName: *databaseName
   866              command:
   867                aggregate: 1
   868  - description: "operation fails after two consecutive socket timeouts - aggregate on database"
   869    operations:
   870      - name: failPoint
   871        object: testRunner
   872        arguments:
   873          client: *failPointClient
   874          failPoint:
   875            configureFailPoint: failCommand
   876            mode: { times: 2 }
   877            data:
   878              failCommands: ["aggregate"]
   879              blockConnection: true
   880              blockTimeMS: 110
   881      - name: aggregate
   882        object: *database
   883        arguments:
   884          pipeline: [ { $listLocalSessions: {} }, { $limit: 1 } ]
   885          
   886        expectError:
   887            # Network errors are considered client errors by the unified test format spec.
   888            isClientError: true
   889    expectEvents:
   890      - client: *client
   891        events:
   892          - commandStartedEvent:
   893              commandName: aggregate
   894              databaseName: *databaseName
   895              command:
   896                aggregate: 1
   897          - commandStartedEvent:
   898              commandName: aggregate
   899              databaseName: *databaseName
   900              command:
   901                aggregate: 1
   902  - description: "operation succeeds after one socket timeout - listCollections on database"
   903    operations:
   904      - name: failPoint
   905        object: testRunner
   906        arguments:
   907          client: *failPointClient
   908          failPoint:
   909            configureFailPoint: failCommand
   910            mode: { times: 1 }
   911            data:
   912              failCommands: ["listCollections"]
   913              blockConnection: true
   914              blockTimeMS: 110
   915      - name: listCollections
   916        object: *database
   917        arguments:
   918          filter: {}
   919          
   920    expectEvents:
   921      - client: *client
   922        events:
   923          - commandStartedEvent:
   924              commandName: listCollections
   925              databaseName: *databaseName
   926              command:
   927                listCollections: 1
   928          - commandStartedEvent:
   929              commandName: listCollections
   930              databaseName: *databaseName
   931              command:
   932                listCollections: 1
   933  - description: "operation fails after two consecutive socket timeouts - listCollections on database"
   934    operations:
   935      - name: failPoint
   936        object: testRunner
   937        arguments:
   938          client: *failPointClient
   939          failPoint:
   940            configureFailPoint: failCommand
   941            mode: { times: 2 }
   942            data:
   943              failCommands: ["listCollections"]
   944              blockConnection: true
   945              blockTimeMS: 110
   946      - name: listCollections
   947        object: *database
   948        arguments:
   949          filter: {}
   950          
   951        expectError:
   952            # Network errors are considered client errors by the unified test format spec.
   953            isClientError: true
   954    expectEvents:
   955      - client: *client
   956        events:
   957          - commandStartedEvent:
   958              commandName: listCollections
   959              databaseName: *databaseName
   960              command:
   961                listCollections: 1
   962          - commandStartedEvent:
   963              commandName: listCollections
   964              databaseName: *databaseName
   965              command:
   966                listCollections: 1
   967  - description: "operation succeeds after one socket timeout - listCollectionNames on database"
   968    operations:
   969      - name: failPoint
   970        object: testRunner
   971        arguments:
   972          client: *failPointClient
   973          failPoint:
   974            configureFailPoint: failCommand
   975            mode: { times: 1 }
   976            data:
   977              failCommands: ["listCollections"]
   978              blockConnection: true
   979              blockTimeMS: 110
   980      - name: listCollectionNames
   981        object: *database
   982        arguments:
   983          filter: {}
   984          
   985    expectEvents:
   986      - client: *client
   987        events:
   988          - commandStartedEvent:
   989              commandName: listCollections
   990              databaseName: *databaseName
   991              command:
   992                listCollections: 1
   993          - commandStartedEvent:
   994              commandName: listCollections
   995              databaseName: *databaseName
   996              command:
   997                listCollections: 1
   998  - description: "operation fails after two consecutive socket timeouts - listCollectionNames on database"
   999    operations:
  1000      - name: failPoint
  1001        object: testRunner
  1002        arguments:
  1003          client: *failPointClient
  1004          failPoint:
  1005            configureFailPoint: failCommand
  1006            mode: { times: 2 }
  1007            data:
  1008              failCommands: ["listCollections"]
  1009              blockConnection: true
  1010              blockTimeMS: 110
  1011      - name: listCollectionNames
  1012        object: *database
  1013        arguments:
  1014          filter: {}
  1015          
  1016        expectError:
  1017            # Network errors are considered client errors by the unified test format spec.
  1018            isClientError: true
  1019    expectEvents:
  1020      - client: *client
  1021        events:
  1022          - commandStartedEvent:
  1023              commandName: listCollections
  1024              databaseName: *databaseName
  1025              command:
  1026                listCollections: 1
  1027          - commandStartedEvent:
  1028              commandName: listCollections
  1029              databaseName: *databaseName
  1030              command:
  1031                listCollections: 1
  1032  - description: "operation succeeds after one socket timeout - createChangeStream on database"
  1033    operations:
  1034      - name: failPoint
  1035        object: testRunner
  1036        arguments:
  1037          client: *failPointClient
  1038          failPoint:
  1039            configureFailPoint: failCommand
  1040            mode: { times: 1 }
  1041            data:
  1042              failCommands: ["aggregate"]
  1043              blockConnection: true
  1044              blockTimeMS: 110
  1045      - name: createChangeStream
  1046        object: *database
  1047        arguments:
  1048          pipeline: []
  1049          
  1050    expectEvents:
  1051      - client: *client
  1052        events:
  1053          - commandStartedEvent:
  1054              commandName: aggregate
  1055              databaseName: *databaseName
  1056              command:
  1057                aggregate: 1
  1058          - commandStartedEvent:
  1059              commandName: aggregate
  1060              databaseName: *databaseName
  1061              command:
  1062                aggregate: 1
  1063  - description: "operation fails after two consecutive socket timeouts - createChangeStream on database"
  1064    operations:
  1065      - name: failPoint
  1066        object: testRunner
  1067        arguments:
  1068          client: *failPointClient
  1069          failPoint:
  1070            configureFailPoint: failCommand
  1071            mode: { times: 2 }
  1072            data:
  1073              failCommands: ["aggregate"]
  1074              blockConnection: true
  1075              blockTimeMS: 110
  1076      - name: createChangeStream
  1077        object: *database
  1078        arguments:
  1079          pipeline: []
  1080          
  1081        expectError:
  1082            # Network errors are considered client errors by the unified test format spec.
  1083            isClientError: true
  1084    expectEvents:
  1085      - client: *client
  1086        events:
  1087          - commandStartedEvent:
  1088              commandName: aggregate
  1089              databaseName: *databaseName
  1090              command:
  1091                aggregate: 1
  1092          - commandStartedEvent:
  1093              commandName: aggregate
  1094              databaseName: *databaseName
  1095              command:
  1096                aggregate: 1
  1097  - description: "operation succeeds after one socket timeout - aggregate on collection"
  1098    operations:
  1099      - name: failPoint
  1100        object: testRunner
  1101        arguments:
  1102          client: *failPointClient
  1103          failPoint:
  1104            configureFailPoint: failCommand
  1105            mode: { times: 1 }
  1106            data:
  1107              failCommands: ["aggregate"]
  1108              blockConnection: true
  1109              blockTimeMS: 110
  1110      - name: aggregate
  1111        object: *collection
  1112        arguments:
  1113          pipeline: []
  1114          
  1115    expectEvents:
  1116      - client: *client
  1117        events:
  1118          - commandStartedEvent:
  1119              commandName: aggregate
  1120              databaseName: *databaseName
  1121              command:
  1122                aggregate: *collectionName
  1123          - commandStartedEvent:
  1124              commandName: aggregate
  1125              databaseName: *databaseName
  1126              command:
  1127                aggregate: *collectionName
  1128  - description: "operation fails after two consecutive socket timeouts - aggregate on collection"
  1129    operations:
  1130      - name: failPoint
  1131        object: testRunner
  1132        arguments:
  1133          client: *failPointClient
  1134          failPoint:
  1135            configureFailPoint: failCommand
  1136            mode: { times: 2 }
  1137            data:
  1138              failCommands: ["aggregate"]
  1139              blockConnection: true
  1140              blockTimeMS: 110
  1141      - name: aggregate
  1142        object: *collection
  1143        arguments:
  1144          pipeline: []
  1145          
  1146        expectError:
  1147            # Network errors are considered client errors by the unified test format spec.
  1148            isClientError: true
  1149    expectEvents:
  1150      - client: *client
  1151        events:
  1152          - commandStartedEvent:
  1153              commandName: aggregate
  1154              databaseName: *databaseName
  1155              command:
  1156                aggregate: *collectionName
  1157          - commandStartedEvent:
  1158              commandName: aggregate
  1159              databaseName: *databaseName
  1160              command:
  1161                aggregate: *collectionName
  1162  - description: "operation succeeds after one socket timeout - count on collection"
  1163    operations:
  1164      - name: failPoint
  1165        object: testRunner
  1166        arguments:
  1167          client: *failPointClient
  1168          failPoint:
  1169            configureFailPoint: failCommand
  1170            mode: { times: 1 }
  1171            data:
  1172              failCommands: ["count"]
  1173              blockConnection: true
  1174              blockTimeMS: 110
  1175      - name: count
  1176        object: *collection
  1177        arguments:
  1178          filter: {}
  1179          
  1180    expectEvents:
  1181      - client: *client
  1182        events:
  1183          - commandStartedEvent:
  1184              commandName: count
  1185              databaseName: *databaseName
  1186              command:
  1187                count: *collectionName
  1188          - commandStartedEvent:
  1189              commandName: count
  1190              databaseName: *databaseName
  1191              command:
  1192                count: *collectionName
  1193  - description: "operation fails after two consecutive socket timeouts - count on collection"
  1194    operations:
  1195      - name: failPoint
  1196        object: testRunner
  1197        arguments:
  1198          client: *failPointClient
  1199          failPoint:
  1200            configureFailPoint: failCommand
  1201            mode: { times: 2 }
  1202            data:
  1203              failCommands: ["count"]
  1204              blockConnection: true
  1205              blockTimeMS: 110
  1206      - name: count
  1207        object: *collection
  1208        arguments:
  1209          filter: {}
  1210          
  1211        expectError:
  1212            # Network errors are considered client errors by the unified test format spec.
  1213            isClientError: true
  1214    expectEvents:
  1215      - client: *client
  1216        events:
  1217          - commandStartedEvent:
  1218              commandName: count
  1219              databaseName: *databaseName
  1220              command:
  1221                count: *collectionName
  1222          - commandStartedEvent:
  1223              commandName: count
  1224              databaseName: *databaseName
  1225              command:
  1226                count: *collectionName
  1227  - description: "operation succeeds after one socket timeout - countDocuments on collection"
  1228    operations:
  1229      - name: failPoint
  1230        object: testRunner
  1231        arguments:
  1232          client: *failPointClient
  1233          failPoint:
  1234            configureFailPoint: failCommand
  1235            mode: { times: 1 }
  1236            data:
  1237              failCommands: ["aggregate"]
  1238              blockConnection: true
  1239              blockTimeMS: 110
  1240      - name: countDocuments
  1241        object: *collection
  1242        arguments:
  1243          filter: {}
  1244          
  1245    expectEvents:
  1246      - client: *client
  1247        events:
  1248          - commandStartedEvent:
  1249              commandName: aggregate
  1250              databaseName: *databaseName
  1251              command:
  1252                aggregate: *collectionName
  1253          - commandStartedEvent:
  1254              commandName: aggregate
  1255              databaseName: *databaseName
  1256              command:
  1257                aggregate: *collectionName
  1258  - description: "operation fails after two consecutive socket timeouts - countDocuments on collection"
  1259    operations:
  1260      - name: failPoint
  1261        object: testRunner
  1262        arguments:
  1263          client: *failPointClient
  1264          failPoint:
  1265            configureFailPoint: failCommand
  1266            mode: { times: 2 }
  1267            data:
  1268              failCommands: ["aggregate"]
  1269              blockConnection: true
  1270              blockTimeMS: 110
  1271      - name: countDocuments
  1272        object: *collection
  1273        arguments:
  1274          filter: {}
  1275          
  1276        expectError:
  1277            # Network errors are considered client errors by the unified test format spec.
  1278            isClientError: true
  1279    expectEvents:
  1280      - client: *client
  1281        events:
  1282          - commandStartedEvent:
  1283              commandName: aggregate
  1284              databaseName: *databaseName
  1285              command:
  1286                aggregate: *collectionName
  1287          - commandStartedEvent:
  1288              commandName: aggregate
  1289              databaseName: *databaseName
  1290              command:
  1291                aggregate: *collectionName
  1292  - description: "operation succeeds after one socket timeout - estimatedDocumentCount on collection"
  1293    operations:
  1294      - name: failPoint
  1295        object: testRunner
  1296        arguments:
  1297          client: *failPointClient
  1298          failPoint:
  1299            configureFailPoint: failCommand
  1300            mode: { times: 1 }
  1301            data:
  1302              failCommands: ["count"]
  1303              blockConnection: true
  1304              blockTimeMS: 110
  1305      - name: estimatedDocumentCount
  1306        object: *collection
  1307        
  1308    expectEvents:
  1309      - client: *client
  1310        events:
  1311          - commandStartedEvent:
  1312              commandName: count
  1313              databaseName: *databaseName
  1314              command:
  1315                count: *collectionName
  1316          - commandStartedEvent:
  1317              commandName: count
  1318              databaseName: *databaseName
  1319              command:
  1320                count: *collectionName
  1321  - description: "operation fails after two consecutive socket timeouts - estimatedDocumentCount on collection"
  1322    operations:
  1323      - name: failPoint
  1324        object: testRunner
  1325        arguments:
  1326          client: *failPointClient
  1327          failPoint:
  1328            configureFailPoint: failCommand
  1329            mode: { times: 2 }
  1330            data:
  1331              failCommands: ["count"]
  1332              blockConnection: true
  1333              blockTimeMS: 110
  1334      - name: estimatedDocumentCount
  1335        object: *collection
  1336        
  1337        expectError:
  1338            # Network errors are considered client errors by the unified test format spec.
  1339            isClientError: true
  1340    expectEvents:
  1341      - client: *client
  1342        events:
  1343          - commandStartedEvent:
  1344              commandName: count
  1345              databaseName: *databaseName
  1346              command:
  1347                count: *collectionName
  1348          - commandStartedEvent:
  1349              commandName: count
  1350              databaseName: *databaseName
  1351              command:
  1352                count: *collectionName
  1353  - description: "operation succeeds after one socket timeout - distinct on collection"
  1354    operations:
  1355      - name: failPoint
  1356        object: testRunner
  1357        arguments:
  1358          client: *failPointClient
  1359          failPoint:
  1360            configureFailPoint: failCommand
  1361            mode: { times: 1 }
  1362            data:
  1363              failCommands: ["distinct"]
  1364              blockConnection: true
  1365              blockTimeMS: 110
  1366      - name: distinct
  1367        object: *collection
  1368        arguments:
  1369          fieldName: x
  1370          filter: {}
  1371          
  1372    expectEvents:
  1373      - client: *client
  1374        events:
  1375          - commandStartedEvent:
  1376              commandName: distinct
  1377              databaseName: *databaseName
  1378              command:
  1379                distinct: *collectionName
  1380          - commandStartedEvent:
  1381              commandName: distinct
  1382              databaseName: *databaseName
  1383              command:
  1384                distinct: *collectionName
  1385  - description: "operation fails after two consecutive socket timeouts - distinct on collection"
  1386    operations:
  1387      - name: failPoint
  1388        object: testRunner
  1389        arguments:
  1390          client: *failPointClient
  1391          failPoint:
  1392            configureFailPoint: failCommand
  1393            mode: { times: 2 }
  1394            data:
  1395              failCommands: ["distinct"]
  1396              blockConnection: true
  1397              blockTimeMS: 110
  1398      - name: distinct
  1399        object: *collection
  1400        arguments:
  1401          fieldName: x
  1402          filter: {}
  1403          
  1404        expectError:
  1405            # Network errors are considered client errors by the unified test format spec.
  1406            isClientError: true
  1407    expectEvents:
  1408      - client: *client
  1409        events:
  1410          - commandStartedEvent:
  1411              commandName: distinct
  1412              databaseName: *databaseName
  1413              command:
  1414                distinct: *collectionName
  1415          - commandStartedEvent:
  1416              commandName: distinct
  1417              databaseName: *databaseName
  1418              command:
  1419                distinct: *collectionName
  1420  - description: "operation succeeds after one socket timeout - find on collection"
  1421    operations:
  1422      - name: failPoint
  1423        object: testRunner
  1424        arguments:
  1425          client: *failPointClient
  1426          failPoint:
  1427            configureFailPoint: failCommand
  1428            mode: { times: 1 }
  1429            data:
  1430              failCommands: ["find"]
  1431              blockConnection: true
  1432              blockTimeMS: 110
  1433      - name: find
  1434        object: *collection
  1435        arguments:
  1436          filter: {}
  1437          
  1438    expectEvents:
  1439      - client: *client
  1440        events:
  1441          - commandStartedEvent:
  1442              commandName: find
  1443              databaseName: *databaseName
  1444              command:
  1445                find: *collectionName
  1446          - commandStartedEvent:
  1447              commandName: find
  1448              databaseName: *databaseName
  1449              command:
  1450                find: *collectionName
  1451  - description: "operation fails after two consecutive socket timeouts - find on collection"
  1452    operations:
  1453      - name: failPoint
  1454        object: testRunner
  1455        arguments:
  1456          client: *failPointClient
  1457          failPoint:
  1458            configureFailPoint: failCommand
  1459            mode: { times: 2 }
  1460            data:
  1461              failCommands: ["find"]
  1462              blockConnection: true
  1463              blockTimeMS: 110
  1464      - name: find
  1465        object: *collection
  1466        arguments:
  1467          filter: {}
  1468          
  1469        expectError:
  1470            # Network errors are considered client errors by the unified test format spec.
  1471            isClientError: true
  1472    expectEvents:
  1473      - client: *client
  1474        events:
  1475          - commandStartedEvent:
  1476              commandName: find
  1477              databaseName: *databaseName
  1478              command:
  1479                find: *collectionName
  1480          - commandStartedEvent:
  1481              commandName: find
  1482              databaseName: *databaseName
  1483              command:
  1484                find: *collectionName
  1485  - description: "operation succeeds after one socket timeout - findOne on collection"
  1486    operations:
  1487      - name: failPoint
  1488        object: testRunner
  1489        arguments:
  1490          client: *failPointClient
  1491          failPoint:
  1492            configureFailPoint: failCommand
  1493            mode: { times: 1 }
  1494            data:
  1495              failCommands: ["find"]
  1496              blockConnection: true
  1497              blockTimeMS: 110
  1498      - name: findOne
  1499        object: *collection
  1500        arguments:
  1501          filter: {}
  1502          
  1503    expectEvents:
  1504      - client: *client
  1505        events:
  1506          - commandStartedEvent:
  1507              commandName: find
  1508              databaseName: *databaseName
  1509              command:
  1510                find: *collectionName
  1511          - commandStartedEvent:
  1512              commandName: find
  1513              databaseName: *databaseName
  1514              command:
  1515                find: *collectionName
  1516  - description: "operation fails after two consecutive socket timeouts - findOne on collection"
  1517    operations:
  1518      - name: failPoint
  1519        object: testRunner
  1520        arguments:
  1521          client: *failPointClient
  1522          failPoint:
  1523            configureFailPoint: failCommand
  1524            mode: { times: 2 }
  1525            data:
  1526              failCommands: ["find"]
  1527              blockConnection: true
  1528              blockTimeMS: 110
  1529      - name: findOne
  1530        object: *collection
  1531        arguments:
  1532          filter: {}
  1533          
  1534        expectError:
  1535            # Network errors are considered client errors by the unified test format spec.
  1536            isClientError: true
  1537    expectEvents:
  1538      - client: *client
  1539        events:
  1540          - commandStartedEvent:
  1541              commandName: find
  1542              databaseName: *databaseName
  1543              command:
  1544                find: *collectionName
  1545          - commandStartedEvent:
  1546              commandName: find
  1547              databaseName: *databaseName
  1548              command:
  1549                find: *collectionName
  1550  - description: "operation succeeds after one socket timeout - listIndexes on collection"
  1551    operations:
  1552      - name: failPoint
  1553        object: testRunner
  1554        arguments:
  1555          client: *failPointClient
  1556          failPoint:
  1557            configureFailPoint: failCommand
  1558            mode: { times: 1 }
  1559            data:
  1560              failCommands: ["listIndexes"]
  1561              blockConnection: true
  1562              blockTimeMS: 110
  1563      - name: listIndexes
  1564        object: *collection
  1565        
  1566    expectEvents:
  1567      - client: *client
  1568        events:
  1569          - commandStartedEvent:
  1570              commandName: listIndexes
  1571              databaseName: *databaseName
  1572              command:
  1573                listIndexes: *collectionName
  1574          - commandStartedEvent:
  1575              commandName: listIndexes
  1576              databaseName: *databaseName
  1577              command:
  1578                listIndexes: *collectionName
  1579  - description: "operation fails after two consecutive socket timeouts - listIndexes on collection"
  1580    operations:
  1581      - name: failPoint
  1582        object: testRunner
  1583        arguments:
  1584          client: *failPointClient
  1585          failPoint:
  1586            configureFailPoint: failCommand
  1587            mode: { times: 2 }
  1588            data:
  1589              failCommands: ["listIndexes"]
  1590              blockConnection: true
  1591              blockTimeMS: 110
  1592      - name: listIndexes
  1593        object: *collection
  1594        
  1595        expectError:
  1596            # Network errors are considered client errors by the unified test format spec.
  1597            isClientError: true
  1598    expectEvents:
  1599      - client: *client
  1600        events:
  1601          - commandStartedEvent:
  1602              commandName: listIndexes
  1603              databaseName: *databaseName
  1604              command:
  1605                listIndexes: *collectionName
  1606          - commandStartedEvent:
  1607              commandName: listIndexes
  1608              databaseName: *databaseName
  1609              command:
  1610                listIndexes: *collectionName
  1611  - description: "operation succeeds after one socket timeout - createChangeStream on collection"
  1612    operations:
  1613      - name: failPoint
  1614        object: testRunner
  1615        arguments:
  1616          client: *failPointClient
  1617          failPoint:
  1618            configureFailPoint: failCommand
  1619            mode: { times: 1 }
  1620            data:
  1621              failCommands: ["aggregate"]
  1622              blockConnection: true
  1623              blockTimeMS: 110
  1624      - name: createChangeStream
  1625        object: *collection
  1626        arguments:
  1627          pipeline: []
  1628          
  1629    expectEvents:
  1630      - client: *client
  1631        events:
  1632          - commandStartedEvent:
  1633              commandName: aggregate
  1634              databaseName: *databaseName
  1635              command:
  1636                aggregate: *collectionName
  1637          - commandStartedEvent:
  1638              commandName: aggregate
  1639              databaseName: *databaseName
  1640              command:
  1641                aggregate: *collectionName
  1642  - description: "operation fails after two consecutive socket timeouts - createChangeStream on collection"
  1643    operations:
  1644      - name: failPoint
  1645        object: testRunner
  1646        arguments:
  1647          client: *failPointClient
  1648          failPoint:
  1649            configureFailPoint: failCommand
  1650            mode: { times: 2 }
  1651            data:
  1652              failCommands: ["aggregate"]
  1653              blockConnection: true
  1654              blockTimeMS: 110
  1655      - name: createChangeStream
  1656        object: *collection
  1657        arguments:
  1658          pipeline: []
  1659          
  1660        expectError:
  1661            # Network errors are considered client errors by the unified test format spec.
  1662            isClientError: true
  1663    expectEvents:
  1664      - client: *client
  1665        events:
  1666          - commandStartedEvent:
  1667              commandName: aggregate
  1668              databaseName: *databaseName
  1669              command:
  1670                aggregate: *collectionName
  1671          - commandStartedEvent:
  1672              commandName: aggregate
  1673              databaseName: *databaseName
  1674              command:
  1675                aggregate: *collectionName
  1676  

View as plain text