...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/estimatedDocumentCount.json

Documentation: go.mongodb.org/mongo-driver/testdata/retryable-reads

     1{
     2  "runOn": [
     3    {
     4      "minServerVersion": "4.0",
     5      "topology": [
     6        "single",
     7        "replicaset"
     8      ]
     9    },
    10    {
    11      "minServerVersion": "4.1.7",
    12      "topology": [
    13        "sharded"
    14      ]
    15    }
    16  ],
    17  "database_name": "retryable-reads-tests",
    18  "collection_name": "coll",
    19  "data": [
    20    {
    21      "_id": 1,
    22      "x": 11
    23    },
    24    {
    25      "_id": 2,
    26      "x": 22
    27    }
    28  ],
    29  "tests": [
    30    {
    31      "description": "EstimatedDocumentCount succeeds on first attempt",
    32      "operations": [
    33        {
    34          "name": "estimatedDocumentCount",
    35          "object": "collection",
    36          "result": 2
    37        }
    38      ],
    39      "expectations": [
    40        {
    41          "command_started_event": {
    42            "command": {
    43              "count": "coll"
    44            },
    45            "database_name": "retryable-reads-tests"
    46          }
    47        }
    48      ]
    49    },
    50    {
    51      "description": "EstimatedDocumentCount succeeds on second attempt",
    52      "failPoint": {
    53        "configureFailPoint": "failCommand",
    54        "mode": {
    55          "times": 1
    56        },
    57        "data": {
    58          "failCommands": [
    59            "count"
    60          ],
    61          "closeConnection": true
    62        }
    63      },
    64      "operations": [
    65        {
    66          "name": "estimatedDocumentCount",
    67          "object": "collection",
    68          "result": 2
    69        }
    70      ],
    71      "expectations": [
    72        {
    73          "command_started_event": {
    74            "command": {
    75              "count": "coll"
    76            },
    77            "database_name": "retryable-reads-tests"
    78          }
    79        },
    80        {
    81          "command_started_event": {
    82            "command": {
    83              "count": "coll"
    84            },
    85            "database_name": "retryable-reads-tests"
    86          }
    87        }
    88      ]
    89    },
    90    {
    91      "description": "EstimatedDocumentCount fails on first attempt",
    92      "clientOptions": {
    93        "retryReads": false
    94      },
    95      "failPoint": {
    96        "configureFailPoint": "failCommand",
    97        "mode": {
    98          "times": 1
    99        },
   100        "data": {
   101          "failCommands": [
   102            "count"
   103          ],
   104          "closeConnection": true
   105        }
   106      },
   107      "operations": [
   108        {
   109          "name": "estimatedDocumentCount",
   110          "object": "collection",
   111          "error": true
   112        }
   113      ],
   114      "expectations": [
   115        {
   116          "command_started_event": {
   117            "command": {
   118              "count": "coll"
   119            },
   120            "database_name": "retryable-reads-tests"
   121          }
   122        }
   123      ]
   124    },
   125    {
   126      "description": "EstimatedDocumentCount fails on second attempt",
   127      "failPoint": {
   128        "configureFailPoint": "failCommand",
   129        "mode": {
   130          "times": 2
   131        },
   132        "data": {
   133          "failCommands": [
   134            "count"
   135          ],
   136          "closeConnection": true
   137        }
   138      },
   139      "operations": [
   140        {
   141          "name": "estimatedDocumentCount",
   142          "object": "collection",
   143          "error": true
   144        }
   145      ],
   146      "expectations": [
   147        {
   148          "command_started_event": {
   149            "command": {
   150              "count": "coll"
   151            },
   152            "database_name": "retryable-reads-tests"
   153          }
   154        },
   155        {
   156          "command_started_event": {
   157            "command": {
   158              "count": "coll"
   159            },
   160            "database_name": "retryable-reads-tests"
   161          }
   162        }
   163      ]
   164    }
   165  ]
   166}

View as plain text