...

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

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

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

View as plain text