...

Text file src/go.mongodb.org/mongo-driver/testdata/retryable-reads/changeStreams-client.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": "client.watch succeeds on first attempt",
    29      "operations": [
    30        {
    31          "name": "watch",
    32          "object": "client"
    33        }
    34      ],
    35      "expectations": [
    36        {
    37          "command_started_event": {
    38            "command": {
    39              "aggregate": 1,
    40              "cursor": {},
    41              "pipeline": [
    42                {
    43                  "$changeStream": {
    44                    "allChangesForCluster": true
    45                  }
    46                }
    47              ]
    48            },
    49            "database_name": "admin"
    50          }
    51        }
    52      ]
    53    },
    54    {
    55      "description": "client.watch succeeds on second attempt",
    56      "failPoint": {
    57        "configureFailPoint": "failCommand",
    58        "mode": {
    59          "times": 1
    60        },
    61        "data": {
    62          "failCommands": [
    63            "aggregate"
    64          ],
    65          "closeConnection": true
    66        }
    67      },
    68      "operations": [
    69        {
    70          "name": "watch",
    71          "object": "client"
    72        }
    73      ],
    74      "expectations": [
    75        {
    76          "command_started_event": {
    77            "command": {
    78              "aggregate": 1,
    79              "cursor": {},
    80              "pipeline": [
    81                {
    82                  "$changeStream": {
    83                    "allChangesForCluster": true
    84                  }
    85                }
    86              ]
    87            },
    88            "database_name": "admin"
    89          }
    90        },
    91        {
    92          "command_started_event": {
    93            "command": {
    94              "aggregate": 1,
    95              "cursor": {},
    96              "pipeline": [
    97                {
    98                  "$changeStream": {
    99                    "allChangesForCluster": true
   100                  }
   101                }
   102              ]
   103            },
   104            "database_name": "admin"
   105          }
   106        }
   107      ]
   108    },
   109    {
   110      "description": "client.watch fails on first attempt",
   111      "clientOptions": {
   112        "retryReads": false
   113      },
   114      "failPoint": {
   115        "configureFailPoint": "failCommand",
   116        "mode": {
   117          "times": 1
   118        },
   119        "data": {
   120          "failCommands": [
   121            "aggregate"
   122          ],
   123          "closeConnection": true
   124        }
   125      },
   126      "operations": [
   127        {
   128          "name": "watch",
   129          "object": "client",
   130          "error": true
   131        }
   132      ],
   133      "expectations": [
   134        {
   135          "command_started_event": {
   136            "command": {
   137              "aggregate": 1,
   138              "cursor": {},
   139              "pipeline": [
   140                {
   141                  "$changeStream": {
   142                    "allChangesForCluster": true
   143                  }
   144                }
   145              ]
   146            },
   147            "database_name": "admin"
   148          }
   149        }
   150      ]
   151    },
   152    {
   153      "description": "client.watch fails on second attempt",
   154      "failPoint": {
   155        "configureFailPoint": "failCommand",
   156        "mode": {
   157          "times": 2
   158        },
   159        "data": {
   160          "failCommands": [
   161            "aggregate"
   162          ],
   163          "closeConnection": true
   164        }
   165      },
   166      "operations": [
   167        {
   168          "name": "watch",
   169          "object": "client",
   170          "error": true
   171        }
   172      ],
   173      "expectations": [
   174        {
   175          "command_started_event": {
   176            "command": {
   177              "aggregate": 1,
   178              "cursor": {},
   179              "pipeline": [
   180                {
   181                  "$changeStream": {
   182                    "allChangesForCluster": true
   183                  }
   184                }
   185              ]
   186            },
   187            "database_name": "admin"
   188          }
   189        },
   190        {
   191          "command_started_event": {
   192            "command": {
   193              "aggregate": 1,
   194              "cursor": {},
   195              "pipeline": [
   196                {
   197                  "$changeStream": {
   198                    "allChangesForCluster": true
   199                  }
   200                }
   201              ]
   202            },
   203            "database_name": "admin"
   204          }
   205        }
   206      ]
   207    }
   208  ]
   209}

View as plain text