...

Text file src/go.mongodb.org/mongo-driver/testdata/client-side-operations-timeout/gridfs-advanced.json

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

     1{
     2  "description": "timeoutMS behaves correctly for advanced GridFS API operations",
     3  "schemaVersion": "1.9",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "4.4",
     7      "serverless": "forbid"
     8    }
     9  ],
    10  "createEntities": [
    11    {
    12      "client": {
    13        "id": "failPointClient",
    14        "useMultipleMongoses": false
    15      }
    16    },
    17    {
    18      "client": {
    19        "id": "client",
    20        "uriOptions": {
    21          "timeoutMS": 75
    22        },
    23        "useMultipleMongoses": false,
    24        "observeEvents": [
    25          "commandStartedEvent"
    26        ]
    27      }
    28    },
    29    {
    30      "database": {
    31        "id": "database",
    32        "client": "client",
    33        "databaseName": "test"
    34      }
    35    },
    36    {
    37      "bucket": {
    38        "id": "bucket",
    39        "database": "database"
    40      }
    41    },
    42    {
    43      "collection": {
    44        "id": "filesCollection",
    45        "database": "database",
    46        "collectionName": "fs.files"
    47      }
    48    },
    49    {
    50      "collection": {
    51        "id": "chunksCollection",
    52        "database": "database",
    53        "collectionName": "fs.chunks"
    54      }
    55    }
    56  ],
    57  "initialData": [
    58    {
    59      "collectionName": "fs.files",
    60      "databaseName": "test",
    61      "documents": [
    62        {
    63          "_id": {
    64            "$oid": "000000000000000000000005"
    65          },
    66          "length": 8,
    67          "chunkSize": 4,
    68          "uploadDate": {
    69            "$date": "1970-01-01T00:00:00.000Z"
    70          },
    71          "filename": "length-8",
    72          "contentType": "application/octet-stream",
    73          "aliases": [],
    74          "metadata": {}
    75        }
    76      ]
    77    },
    78    {
    79      "collectionName": "fs.chunks",
    80      "databaseName": "test",
    81      "documents": [
    82        {
    83          "_id": {
    84            "$oid": "000000000000000000000005"
    85          },
    86          "files_id": {
    87            "$oid": "000000000000000000000005"
    88          },
    89          "n": 0,
    90          "data": {
    91            "$binary": {
    92              "base64": "ESIzRA==",
    93              "subType": "00"
    94            }
    95          }
    96        },
    97        {
    98          "_id": {
    99            "$oid": "000000000000000000000006"
   100          },
   101          "files_id": {
   102            "$oid": "000000000000000000000005"
   103          },
   104          "n": 1,
   105          "data": {
   106            "$binary": {
   107              "base64": "ESIzRA==",
   108              "subType": "00"
   109            }
   110          }
   111        }
   112      ]
   113    }
   114  ],
   115  "tests": [
   116    {
   117      "description": "timeoutMS can be overridden for a rename",
   118      "operations": [
   119        {
   120          "name": "failPoint",
   121          "object": "testRunner",
   122          "arguments": {
   123            "client": "failPointClient",
   124            "failPoint": {
   125              "configureFailPoint": "failCommand",
   126              "mode": {
   127                "times": 1
   128              },
   129              "data": {
   130                "failCommands": [
   131                  "update"
   132                ],
   133                "blockConnection": true,
   134                "blockTimeMS": 100
   135              }
   136            }
   137          }
   138        },
   139        {
   140          "name": "rename",
   141          "object": "bucket",
   142          "arguments": {
   143            "id": {
   144              "$oid": "000000000000000000000005"
   145            },
   146            "newFilename": "foo",
   147            "timeoutMS": 2000
   148          }
   149        }
   150      ],
   151      "expectEvents": [
   152        {
   153          "client": "client",
   154          "events": [
   155            {
   156              "commandStartedEvent": {
   157                "commandName": "update",
   158                "databaseName": "test",
   159                "command": {
   160                  "update": "fs.files",
   161                  "maxTimeMS": {
   162                    "$$type": [
   163                      "int",
   164                      "long"
   165                    ]
   166                  }
   167                }
   168              }
   169            }
   170          ]
   171        }
   172      ]
   173    },
   174    {
   175      "description": "timeoutMS applied to update during a rename",
   176      "operations": [
   177        {
   178          "name": "failPoint",
   179          "object": "testRunner",
   180          "arguments": {
   181            "client": "failPointClient",
   182            "failPoint": {
   183              "configureFailPoint": "failCommand",
   184              "mode": {
   185                "times": 1
   186              },
   187              "data": {
   188                "failCommands": [
   189                  "update"
   190                ],
   191                "blockConnection": true,
   192                "blockTimeMS": 100
   193              }
   194            }
   195          }
   196        },
   197        {
   198          "name": "rename",
   199          "object": "bucket",
   200          "arguments": {
   201            "id": {
   202              "$oid": "000000000000000000000005"
   203            },
   204            "newFilename": "foo"
   205          },
   206          "expectError": {
   207            "isTimeoutError": true
   208          }
   209        }
   210      ],
   211      "expectEvents": [
   212        {
   213          "client": "client",
   214          "events": [
   215            {
   216              "commandStartedEvent": {
   217                "commandName": "update",
   218                "databaseName": "test",
   219                "command": {
   220                  "update": "fs.files",
   221                  "maxTimeMS": {
   222                    "$$type": [
   223                      "int",
   224                      "long"
   225                    ]
   226                  }
   227                }
   228              }
   229            }
   230          ]
   231        }
   232      ]
   233    },
   234    {
   235      "description": "timeoutMS can be overridden for drop",
   236      "operations": [
   237        {
   238          "name": "failPoint",
   239          "object": "testRunner",
   240          "arguments": {
   241            "client": "failPointClient",
   242            "failPoint": {
   243              "configureFailPoint": "failCommand",
   244              "mode": {
   245                "times": 1
   246              },
   247              "data": {
   248                "failCommands": [
   249                  "drop"
   250                ],
   251                "blockConnection": true,
   252                "blockTimeMS": 100
   253              }
   254            }
   255          }
   256        },
   257        {
   258          "name": "drop",
   259          "object": "bucket",
   260          "arguments": {
   261            "timeoutMS": 2000
   262          }
   263        }
   264      ]
   265    },
   266    {
   267      "description": "timeoutMS applied to files collection drop",
   268      "operations": [
   269        {
   270          "name": "failPoint",
   271          "object": "testRunner",
   272          "arguments": {
   273            "client": "failPointClient",
   274            "failPoint": {
   275              "configureFailPoint": "failCommand",
   276              "mode": {
   277                "times": 1
   278              },
   279              "data": {
   280                "failCommands": [
   281                  "drop"
   282                ],
   283                "blockConnection": true,
   284                "blockTimeMS": 100
   285              }
   286            }
   287          }
   288        },
   289        {
   290          "name": "drop",
   291          "object": "bucket",
   292          "expectError": {
   293            "isTimeoutError": true
   294          }
   295        }
   296      ],
   297      "expectEvents": [
   298        {
   299          "client": "client",
   300          "events": [
   301            {
   302              "commandStartedEvent": {
   303                "commandName": "drop",
   304                "databaseName": "test",
   305                "command": {
   306                  "drop": "fs.files",
   307                  "maxTimeMS": {
   308                    "$$type": [
   309                      "int",
   310                      "long"
   311                    ]
   312                  }
   313                }
   314              }
   315            }
   316          ]
   317        }
   318      ]
   319    },
   320    {
   321      "description": "timeoutMS applied to chunks collection drop",
   322      "operations": [
   323        {
   324          "name": "failPoint",
   325          "object": "testRunner",
   326          "arguments": {
   327            "client": "failPointClient",
   328            "failPoint": {
   329              "configureFailPoint": "failCommand",
   330              "mode": {
   331                "skip": 1
   332              },
   333              "data": {
   334                "failCommands": [
   335                  "drop"
   336                ],
   337                "blockConnection": true,
   338                "blockTimeMS": 100
   339              }
   340            }
   341          }
   342        },
   343        {
   344          "name": "drop",
   345          "object": "bucket",
   346          "expectError": {
   347            "isTimeoutError": true
   348          }
   349        }
   350      ]
   351    },
   352    {
   353      "description": "timeoutMS applied to drop as a whole, not individual parts",
   354      "operations": [
   355        {
   356          "name": "failPoint",
   357          "object": "testRunner",
   358          "arguments": {
   359            "client": "failPointClient",
   360            "failPoint": {
   361              "configureFailPoint": "failCommand",
   362              "mode": {
   363                "times": 2
   364              },
   365              "data": {
   366                "failCommands": [
   367                  "drop"
   368                ],
   369                "blockConnection": true,
   370                "blockTimeMS": 50
   371              }
   372            }
   373          }
   374        },
   375        {
   376          "name": "drop",
   377          "object": "bucket",
   378          "expectError": {
   379            "isTimeoutError": true
   380          }
   381        }
   382      ]
   383    }
   384  ]
   385}

View as plain text