...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/changeStreams-db.coll.watch.json

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

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

View as plain text