...

Text file src/go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/unified/interruptInUse-pool-clear.json

Documentation: go.mongodb.org/mongo-driver/testdata/server-discovery-and-monitoring/unified

     1{
     2  "description": "interruptInUse",
     3  "schemaVersion": "1.11",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "4.9",
     7      "serverless": "forbid",
     8      "topologies": [
     9        "replicaset",
    10        "sharded"
    11      ]
    12    }
    13  ],
    14  "createEntities": [
    15    {
    16      "client": {
    17        "id": "setupClient",
    18        "useMultipleMongoses": false
    19      }
    20    }
    21  ],
    22  "initialData": [
    23    {
    24      "collectionName": "interruptInUse",
    25      "databaseName": "sdam-tests",
    26      "documents": []
    27    }
    28  ],
    29  "tests": [
    30    {
    31      "description": "Connection pool clear uses interruptInUseConnections=true after monitor timeout",
    32      "operations": [
    33        {
    34          "name": "createEntities",
    35          "object": "testRunner",
    36          "arguments": {
    37            "entities": [
    38              {
    39                "client": {
    40                  "id": "client",
    41                  "useMultipleMongoses": false,
    42                  "observeEvents": [
    43                    "poolClearedEvent",
    44                    "connectionClosedEvent",
    45                    "commandStartedEvent",
    46                    "commandSucceededEvent",
    47                    "commandFailedEvent",
    48                    "connectionCheckedOutEvent",
    49                    "connectionCheckedInEvent"
    50                  ],
    51                  "uriOptions": {
    52                    "connectTimeoutMS": 500,
    53                    "heartbeatFrequencyMS": 500,
    54                    "appname": "interruptInUse",
    55                    "retryReads": false,
    56                    "minPoolSize": 0
    57                  }
    58                }
    59              },
    60              {
    61                "database": {
    62                  "id": "database",
    63                  "client": "client",
    64                  "databaseName": "sdam-tests"
    65                }
    66              },
    67              {
    68                "collection": {
    69                  "id": "collection",
    70                  "database": "database",
    71                  "collectionName": "interruptInUse"
    72                }
    73              },
    74              {
    75                "thread": {
    76                  "id": "thread1"
    77                }
    78              }
    79            ]
    80          }
    81        },
    82        {
    83          "name": "insertOne",
    84          "object": "collection",
    85          "arguments": {
    86            "document": {
    87              "_id": 1
    88            }
    89          }
    90        },
    91        {
    92          "name": "runOnThread",
    93          "object": "testRunner",
    94          "arguments": {
    95            "thread": "thread1",
    96            "operation": {
    97              "name": "find",
    98              "object": "collection",
    99              "arguments": {
   100                "filter": {
   101                  "$where": "sleep(2000) || true"
   102                }
   103              },
   104              "expectError": {
   105                "isError": true
   106              }
   107            }
   108          }
   109        },
   110        {
   111          "name": "failPoint",
   112          "object": "testRunner",
   113          "arguments": {
   114            "client": "setupClient",
   115            "failPoint": {
   116              "configureFailPoint": "failCommand",
   117              "mode": {
   118                "times": 4
   119              },
   120              "data": {
   121                "failCommands": [
   122                  "hello",
   123                  "isMaster"
   124                ],
   125                "blockConnection": true,
   126                "blockTimeMS": 1500,
   127                "appName": "interruptInUse"
   128              }
   129            }
   130          }
   131        },
   132        {
   133          "name": "waitForThread",
   134          "object": "testRunner",
   135          "arguments": {
   136            "thread": "thread1"
   137          }
   138        }
   139      ],
   140      "expectEvents": [
   141        {
   142          "client": "client",
   143          "eventType": "command",
   144          "events": [
   145            {
   146              "commandStartedEvent": {
   147                "commandName": "insert"
   148              }
   149            },
   150            {
   151              "commandSucceededEvent": {
   152                "commandName": "insert"
   153              }
   154            },
   155            {
   156              "commandStartedEvent": {
   157                "commandName": "find"
   158              }
   159            },
   160            {
   161              "commandFailedEvent": {
   162                "commandName": "find"
   163              }
   164            }
   165          ]
   166        },
   167        {
   168          "client": "client",
   169          "eventType": "cmap",
   170          "events": [
   171            {
   172              "connectionCheckedOutEvent": {}
   173            },
   174            {
   175              "connectionCheckedInEvent": {}
   176            },
   177            {
   178              "connectionCheckedOutEvent": {}
   179            },
   180            {
   181              "poolClearedEvent": {
   182                "interruptInUseConnections": true
   183              }
   184            },
   185            {
   186              "connectionCheckedInEvent": {}
   187            },
   188            {
   189              "connectionClosedEvent": {}
   190            }
   191          ]
   192        }
   193      ],
   194      "outcome": [
   195        {
   196          "collectionName": "interruptInUse",
   197          "databaseName": "sdam-tests",
   198          "documents": [
   199            {
   200              "_id": 1
   201            }
   202          ]
   203        }
   204      ]
   205    },
   206    {
   207      "description": "Error returned from connection pool clear with interruptInUseConnections=true is retryable",
   208      "operations": [
   209        {
   210          "name": "createEntities",
   211          "object": "testRunner",
   212          "arguments": {
   213            "entities": [
   214              {
   215                "client": {
   216                  "id": "client",
   217                  "useMultipleMongoses": false,
   218                  "observeEvents": [
   219                    "poolClearedEvent",
   220                    "connectionClosedEvent",
   221                    "commandStartedEvent",
   222                    "commandFailedEvent",
   223                    "commandSucceededEvent",
   224                    "connectionCheckedOutEvent",
   225                    "connectionCheckedInEvent"
   226                  ],
   227                  "uriOptions": {
   228                    "connectTimeoutMS": 500,
   229                    "heartbeatFrequencyMS": 500,
   230                    "appname": "interruptInUseRetryable",
   231                    "retryReads": true,
   232                    "minPoolSize": 0
   233                  }
   234                }
   235              },
   236              {
   237                "database": {
   238                  "id": "database",
   239                  "client": "client",
   240                  "databaseName": "sdam-tests"
   241                }
   242              },
   243              {
   244                "collection": {
   245                  "id": "collection",
   246                  "database": "database",
   247                  "collectionName": "interruptInUse"
   248                }
   249              },
   250              {
   251                "thread": {
   252                  "id": "thread1"
   253                }
   254              }
   255            ]
   256          }
   257        },
   258        {
   259          "name": "insertOne",
   260          "object": "collection",
   261          "arguments": {
   262            "document": {
   263              "_id": 1
   264            }
   265          }
   266        },
   267        {
   268          "name": "runOnThread",
   269          "object": "testRunner",
   270          "arguments": {
   271            "thread": "thread1",
   272            "operation": {
   273              "name": "find",
   274              "object": "collection",
   275              "arguments": {
   276                "filter": {
   277                  "$where": "sleep(2000) || true"
   278                }
   279              }
   280            }
   281          }
   282        },
   283        {
   284          "name": "failPoint",
   285          "object": "testRunner",
   286          "arguments": {
   287            "client": "setupClient",
   288            "failPoint": {
   289              "configureFailPoint": "failCommand",
   290              "mode": {
   291                "times": 4
   292              },
   293              "data": {
   294                "failCommands": [
   295                  "hello",
   296                  "isMaster"
   297                ],
   298                "blockConnection": true,
   299                "blockTimeMS": 1500,
   300                "appName": "interruptInUseRetryable"
   301              }
   302            }
   303          }
   304        },
   305        {
   306          "name": "waitForThread",
   307          "object": "testRunner",
   308          "arguments": {
   309            "thread": "thread1"
   310          }
   311        }
   312      ],
   313      "expectEvents": [
   314        {
   315          "client": "client",
   316          "eventType": "command",
   317          "events": [
   318            {
   319              "commandStartedEvent": {
   320                "commandName": "insert"
   321              }
   322            },
   323            {
   324              "commandSucceededEvent": {
   325                "commandName": "insert"
   326              }
   327            },
   328            {
   329              "commandStartedEvent": {
   330                "commandName": "find"
   331              }
   332            },
   333            {
   334              "commandFailedEvent": {
   335                "commandName": "find"
   336              }
   337            },
   338            {
   339              "commandStartedEvent": {
   340                "commandName": "find"
   341              }
   342            },
   343            {
   344              "commandSucceededEvent": {
   345                "commandName": "find"
   346              }
   347            }
   348          ]
   349        },
   350        {
   351          "client": "client",
   352          "eventType": "cmap",
   353          "events": [
   354            {
   355              "connectionCheckedOutEvent": {}
   356            },
   357            {
   358              "connectionCheckedInEvent": {}
   359            },
   360            {
   361              "connectionCheckedOutEvent": {}
   362            },
   363            {
   364              "poolClearedEvent": {
   365                "interruptInUseConnections": true
   366              }
   367            },
   368            {
   369              "connectionCheckedInEvent": {}
   370            },
   371            {
   372              "connectionClosedEvent": {}
   373            },
   374            {
   375              "connectionCheckedOutEvent": {}
   376            },
   377            {
   378              "connectionCheckedInEvent": {}
   379            }
   380          ]
   381        }
   382      ],
   383      "outcome": [
   384        {
   385          "collectionName": "interruptInUse",
   386          "databaseName": "sdam-tests",
   387          "documents": [
   388            {
   389              "_id": 1
   390            }
   391          ]
   392        }
   393      ]
   394    },
   395    {
   396      "description": "Error returned from connection pool clear with interruptInUseConnections=true is retryable for write",
   397      "operations": [
   398        {
   399          "name": "createEntities",
   400          "object": "testRunner",
   401          "arguments": {
   402            "entities": [
   403              {
   404                "client": {
   405                  "id": "client",
   406                  "useMultipleMongoses": false,
   407                  "observeEvents": [
   408                    "poolClearedEvent",
   409                    "connectionClosedEvent",
   410                    "commandStartedEvent",
   411                    "commandFailedEvent",
   412                    "commandSucceededEvent",
   413                    "connectionCheckedOutEvent",
   414                    "connectionCheckedInEvent"
   415                  ],
   416                  "uriOptions": {
   417                    "connectTimeoutMS": 500,
   418                    "heartbeatFrequencyMS": 500,
   419                    "appname": "interruptInUseRetryableWrite",
   420                    "retryWrites": true,
   421                    "minPoolSize": 0
   422                  }
   423                }
   424              },
   425              {
   426                "database": {
   427                  "id": "database",
   428                  "client": "client",
   429                  "databaseName": "sdam-tests"
   430                }
   431              },
   432              {
   433                "collection": {
   434                  "id": "collection",
   435                  "database": "database",
   436                  "collectionName": "interruptInUse"
   437                }
   438              },
   439              {
   440                "thread": {
   441                  "id": "thread1"
   442                }
   443              }
   444            ]
   445          }
   446        },
   447        {
   448          "name": "insertOne",
   449          "object": "collection",
   450          "arguments": {
   451            "document": {
   452              "_id": 1
   453            }
   454          }
   455        },
   456        {
   457          "name": "runOnThread",
   458          "object": "testRunner",
   459          "arguments": {
   460            "thread": "thread1",
   461            "operation": {
   462              "name": "updateOne",
   463              "object": "collection",
   464              "arguments": {
   465                "filter": {
   466                  "$where": "sleep(2000) || true"
   467                },
   468                "update": {
   469                  "$set": {
   470                    "a": "bar"
   471                  }
   472                }
   473              }
   474            }
   475          }
   476        },
   477        {
   478          "name": "failPoint",
   479          "object": "testRunner",
   480          "arguments": {
   481            "client": "setupClient",
   482            "failPoint": {
   483              "configureFailPoint": "failCommand",
   484              "mode": {
   485                "times": 4
   486              },
   487              "data": {
   488                "failCommands": [
   489                  "hello",
   490                  "isMaster"
   491                ],
   492                "blockConnection": true,
   493                "blockTimeMS": 1500,
   494                "appName": "interruptInUseRetryableWrite"
   495              }
   496            }
   497          }
   498        },
   499        {
   500          "name": "waitForThread",
   501          "object": "testRunner",
   502          "arguments": {
   503            "thread": "thread1"
   504          }
   505        }
   506      ],
   507      "expectEvents": [
   508        {
   509          "client": "client",
   510          "eventType": "command",
   511          "events": [
   512            {
   513              "commandStartedEvent": {
   514                "commandName": "insert"
   515              }
   516            },
   517            {
   518              "commandSucceededEvent": {
   519                "commandName": "insert"
   520              }
   521            },
   522            {
   523              "commandStartedEvent": {
   524                "commandName": "update"
   525              }
   526            },
   527            {
   528              "commandFailedEvent": {
   529                "commandName": "update"
   530              }
   531            },
   532            {
   533              "commandStartedEvent": {
   534                "commandName": "update"
   535              }
   536            },
   537            {
   538              "commandSucceededEvent": {
   539                "commandName": "update"
   540              }
   541            }
   542          ]
   543        },
   544        {
   545          "client": "client",
   546          "eventType": "cmap",
   547          "events": [
   548            {
   549              "connectionCheckedOutEvent": {}
   550            },
   551            {
   552              "connectionCheckedInEvent": {}
   553            },
   554            {
   555              "connectionCheckedOutEvent": {}
   556            },
   557            {
   558              "poolClearedEvent": {
   559                "interruptInUseConnections": true
   560              }
   561            },
   562            {
   563              "connectionCheckedInEvent": {}
   564            },
   565            {
   566              "connectionClosedEvent": {}
   567            },
   568            {
   569              "connectionCheckedOutEvent": {}
   570            },
   571            {
   572              "connectionCheckedInEvent": {}
   573            }
   574          ]
   575        }
   576      ],
   577      "outcome": [
   578        {
   579          "collectionName": "interruptInUse",
   580          "databaseName": "sdam-tests",
   581          "documents": [
   582            {
   583              "_id": 1,
   584              "a": "bar"
   585            }
   586          ]
   587        }
   588      ]
   589    }
   590  ]
   591}

View as plain text