...

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

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

     1{
     2  "description": "timeoutMS behaves correctly for GridFS find 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    {
    64      "collectionName": "fs.chunks",
    65      "databaseName": "test",
    66      "documents": []
    67    }
    68  ],
    69  "tests": [
    70    {
    71      "description": "timeoutMS can be overridden for a find",
    72      "operations": [
    73        {
    74          "name": "failPoint",
    75          "object": "testRunner",
    76          "arguments": {
    77            "client": "failPointClient",
    78            "failPoint": {
    79              "configureFailPoint": "failCommand",
    80              "mode": {
    81                "times": 1
    82              },
    83              "data": {
    84                "failCommands": [
    85                  "find"
    86                ],
    87                "blockConnection": true,
    88                "blockTimeMS": 100
    89              }
    90            }
    91          }
    92        },
    93        {
    94          "name": "find",
    95          "object": "bucket",
    96          "arguments": {
    97            "filter": {},
    98            "timeoutMS": 1000
    99          }
   100        }
   101      ],
   102      "expectEvents": [
   103        {
   104          "client": "client",
   105          "events": [
   106            {
   107              "commandStartedEvent": {
   108                "commandName": "find",
   109                "databaseName": "test",
   110                "command": {
   111                  "find": "fs.files",
   112                  "maxTimeMS": {
   113                    "$$type": [
   114                      "int",
   115                      "long"
   116                    ]
   117                  }
   118                }
   119              }
   120            }
   121          ]
   122        }
   123      ]
   124    },
   125    {
   126      "description": "timeoutMS applied to find command",
   127      "operations": [
   128        {
   129          "name": "failPoint",
   130          "object": "testRunner",
   131          "arguments": {
   132            "client": "failPointClient",
   133            "failPoint": {
   134              "configureFailPoint": "failCommand",
   135              "mode": {
   136                "times": 1
   137              },
   138              "data": {
   139                "failCommands": [
   140                  "find"
   141                ],
   142                "blockConnection": true,
   143                "blockTimeMS": 100
   144              }
   145            }
   146          }
   147        },
   148        {
   149          "name": "find",
   150          "object": "bucket",
   151          "arguments": {
   152            "filter": {}
   153          },
   154          "expectError": {
   155            "isTimeoutError": true
   156          }
   157        }
   158      ],
   159      "expectEvents": [
   160        {
   161          "client": "client",
   162          "events": [
   163            {
   164              "commandStartedEvent": {
   165                "commandName": "find",
   166                "databaseName": "test",
   167                "command": {
   168                  "find": "fs.files",
   169                  "maxTimeMS": {
   170                    "$$type": [
   171                      "int",
   172                      "long"
   173                    ]
   174                  }
   175                }
   176              }
   177            }
   178          ]
   179        }
   180      ]
   181    }
   182  ]
   183}

View as plain text